bug-guile
[Top][All Lists]
Advanced

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

Re: 0e1000


From: Andy Wingo
Subject: Re: 0e1000
Date: Sat, 11 Sep 2010 13:11:17 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux)

Hi Bill,

On Sat 11 Sep 2010 00:00, "Bill Schottstaedt" <address@hidden> writes:

> scheme@(guile-user)> 0e1000
> Throw to key `out-of-range':
> ERROR: In procedure string->number:
> ERROR: Value out of range: 1000

It seems that "e" indicates that the number will be inexact, and thus,
in Guile's representation, a double. Guile seems to think that 1000 is
out of range for the exponent of a double (which it thinks to be is -307
to +308), but I have no idea where this idea of the range comes
from. The internet seems to think the range of the exponent for doubles
is -1022 to +1023....

...ah, I see. The range of the exponent for doubles is indeed to +1023,
but that's with a base of 2. With a base of 10 it's about 308.

So! Barring multi-precision floats, it seems that NeM where M > 308 is
out of the range of doubles, and it's better to signal an error than
read it as an inf, I'd imagine.

This N=0 case is special though, because the number is in fact
representable. But I'm not sure that matters. I am inclined to punt on
this issue; what do you think?

Regards,

Andy
-- 
http://wingolog.org/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]