unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* 0e1000
@ 2010-09-10 22:00 Bill Schottstaedt
  2010-09-11 11:11 ` 0e1000 Andy Wingo
  0 siblings, 1 reply; 4+ messages in thread
From: Bill Schottstaedt @ 2010-09-10 22:00 UTC (permalink / raw)
  To: bug-guile

In Guile 1.9.10

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






^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: 0e1000
  2010-09-10 22:00 0e1000 Bill Schottstaedt
@ 2010-09-11 11:11 ` Andy Wingo
  2010-09-11 11:41   ` 0e1000 Bill Schottstaedt
  0 siblings, 1 reply; 4+ messages in thread
From: Andy Wingo @ 2010-09-11 11:11 UTC (permalink / raw)
  To: Bill Schottstaedt; +Cc: bug-guile

Hi Bill,

On Sat 11 Sep 2010 00:00, "Bill Schottstaedt" <bil@ccrma.Stanford.EDU> 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/



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: 0e1000
  2010-09-11 11:11 ` 0e1000 Andy Wingo
@ 2010-09-11 11:41   ` Bill Schottstaedt
  2010-09-12 10:43     ` 0e1000 Andy Wingo
  0 siblings, 1 reply; 4+ messages in thread
From: Bill Schottstaedt @ 2010-09-11 11:41 UTC (permalink / raw)
  To: Andy Wingo; +Cc: bug-guile

> 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? 

I thought it would make you guys smile.




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: 0e1000
  2010-09-11 11:41   ` 0e1000 Bill Schottstaedt
@ 2010-09-12 10:43     ` Andy Wingo
  0 siblings, 0 replies; 4+ messages in thread
From: Andy Wingo @ 2010-09-12 10:43 UTC (permalink / raw)
  To: Bill Schottstaedt; +Cc: bug-guile

On Sat 11 Sep 2010 13:41, "Bill Schottstaedt" <bil@ccrma.Stanford.EDU> writes:

>> 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? 
>
> I thought it would make you guys smile.

It did, once I realized what was going on. Cheers for pointing me to yet
another part of Guile's code that I didn't understand :)

Andy
-- 
http://wingolog.org/



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-09-12 10:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-10 22:00 0e1000 Bill Schottstaedt
2010-09-11 11:11 ` 0e1000 Andy Wingo
2010-09-11 11:41   ` 0e1000 Bill Schottstaedt
2010-09-12 10:43     ` 0e1000 Andy Wingo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).