From: Bruno H. <br...@cl...> - 2003-10-24 13:16:18
|
Sam Steingold wrote: > (/ (float least-positive-short-float 1d0) > (float least-positive-single-float 1d0)) > ==> 0.25 > > (/ (float most-positive-short-float 1d0) > (float most-positive-single-float 1d0)) > ==> 0.5 > > (/ (float short-float-epsilon 1d0) (float single-float-epsilon 1d0)) > ==> 128 > > this means that even though short floats have 7 fewer bits of > precision, they manage to cover _more_ of the real line (twice as much)! > > how could this be? The SINGLE-FLOAT in-memory format in clisp follows IEEE 754, which reserves one particular exponent value for Infinitys and NaNs. Since clisp doesn't support these beasts, neither in SINGLE-FLOAT nor in SHORT-FLOAT, it means that one of the 255 possible exponents in the SINGLE-FLOAT format is wasted. The SHORT-FLOAT format is specific to clisp, not adhering to any standard, and therefore doesn't need to waste one of the 255 possible exponents. Bruno |