[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

float-digits



Paul,

Floating point hackery is not my specialty, but maybe I can give you a
quick answer that will stand unless one of the real experts pops up to
contradict me.

    What is the result of (float-digits 0.0)?

Float-digits tells you how many radix-b digits there are in the
representation of the fractional part (the "significand") of the type of
number you feed it.  It doesn't care at all about the value of the
argument, just about which type of float it is.  So in this case, it
tells you the number of digits (usually bits) in the significand of a
number of the default floating type, as controlled by
*read-default-float-format*. 

    Why isn't "float-radix" a constant?

Float-radix may in principle be different for different types of floats
in the same implementation, though I don't know of any existing
implemenation that does this.  By making it a function, we allow the
user to ask for the float-radix of some particular type of number: the
type of the argument.

-- Scott