37 int ndec = 0, slen = 0;
44 #if FIXEDPT_BITS == 32 46 #elif FIXEDPT_BITS == 64 51 else if (max_dec == -2)
61 tmp[ndec++] =
'0' + ip % 10;
66 str[slen++] = tmp[--ndec];
73 fr = (fr & mask) * 10;
78 }
while (fr != 0 && ndec < max_dec);
80 if (ndec > 1 && str[slen - 1] ==
'0')
105 if (A < FIXEDPT_ONE && A > 6) {
120 int l = (A >> 1) + 1;
121 for (
int i = 0; i < iter; i++)
fixedpt fixedpt_sqrt(fixedpt A)
char base
This version is stamped on May 10, 2016.
void fixedpt_str(fixedpt A, char *str, int max_dec)
Convert the given fixedpt number to a decimal string.
fixedpt fixedpt_log(fixedpt x, fixedpt base)
fixedpt fixedpt_pow(fixedpt n, fixedpt exp)
fixedpt fixedpt_ln(fixedpt x)
static const uint32_t k[]
fixedpt fixedpt_tan(fixedpt A)
fixedpt fixedpt_exp(fixedpt fp)
#define fixedpt_fracpart(A)
fixedpt fixedpt_mul(fixedpt A, fixedpt B)
fixedpt fixedpt_sin(fixedpt fp)
fixedpt fixedpt_div(fixedpt A, fixedpt B)
char * fixedpt_cstr(const fixedpt A, const int max_dec)
fixedpt fixedpt_cos(fixedpt A)
#define fixedpt_rconst(R)
x
Return the smallest n such that 2^n >= _x.