|
From: Stavros M. <mac...@al...> - 2014-02-19 21:46:07
|
It seems to me that -- if this is a good idea at all -- the correct
implementation of automatic conversion of floats to bfloats would have one
simple property: if floats cannot faithfully represent a number to the
nominal precision, it should convert to bfloat.
This means that if the exponent is out of range, or if the mantissa is not
full-precision, then the number should be calculated as bfloat. In
particular, gradual underflow (denormalized numbers) should be treated as
underflow, and the result calculated as a bfloat: (5e-320/3)*3. Similarly,
the input number 5e-320 should be read as the bfloat 5.0b-320, not the
float 4.99994e-320.
I don't know if that is practical with current Lisp implementations, but
without that property, it seems to me that we are giving the user the
*illusion* of getting bfloat properties, not the reality.
-s
On Wed, Feb 19, 2014 at 4:35 PM, Stavros Macrakis <mac...@al...>wrote:
> On Wed, Feb 19, 2014 at 4:08 PM, Raymond Toy <toy...@gm...>wrote:
>
>> 4e-324 is smaller than least-positive-double-float (approx
>> 4.94065d-324), so I would
>> e
>> xpect either an error saying it's not
>> representable or 0.0.
>>
>
> Hmm, I would expect it to round to 4.94e-324, because it is closer to that
> than it is to zero.
>
> -s
>
>
>
|