NAME places - return number of "decimal" places in a fractional part SYNOPSIS places(x [,b]) TYPES x real b integer >= 2, defaults to 10 return integer DESCRIPTION Returns the least non-negative integer n for which b^n * x is an integer, or -1 if there is no such integer. places(x,b) = 0 if and only if x is an integer. If omitted, b is assumed to be 10. If given, b must be an integer > 1. places(x,b) = n > 0 if and only if the fractional part of abs(x) has a finite base-b "decimal" representation with n digits of which the last digit is nonzero. This occurs if and only if every prime factor of den(x) is a factor of b. EXAMPLE > print places(3), places(0.0123), places(3.70), places(1e-10), places(3/7) 0 4 1 10 -1 > print places(0.0123, 2), places(.625, 2), places(.625, 8) -1 3 1 LIMITS b > 1 LINK LIBRARY long qplaces(NUMBER *q, ZVALUE base) SEE ALSO digit, digits