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

Functions for taking apart floating-point numbers

    Date: Friday, 3 June 1983, 14:47-EDT
    From: Robert A. Cassels <Cassels at SCRC-TENEX>
    Proposal:  Remove @f[float-exponent] and @f[float-integer-exponent], and
	       return those numbers as the second values from
	       @f[float-significand] and @f[float-integer-significand].
I think this was turned down last year, but I don't remember why.  It sounds
reasonable to me, except that one would probably want to choose better names
for the two functions.  I'm in favor of it.

    Proposal:  Add new functions @f[float-digits] and @f[float-precision].
I don't understand the need for both of these.  It sounds like float-precision
is the only one you actually need; float-digits returns the same answer except
for certain exceptional numbers.

    Proposal:  Require the result of @f[float-integer-significand] to
	       reflect the precision of the floating-point number.
This sounds reasonable.  The main competing proposal is that it return
a result "normalized to the right" by removing trailing zeros.  Your
proposal seems slightly preferable to that.

    Proposal:  Clarify the result of @f[(float-sign 0.0)], @f[(float-sign
I think this is just a clarification, since the manual indicates that
float-sign with one argument never returns zero even if the argument is zero.