GNU bug report logs -
#18932
string->number errors on e.g. "1e400xyz"
Previous Next
Full log
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
When string->number is given a number in scientific notation with a
very high exponent, it errors with "value out of range."
I don't know if that is acceptable, but what seems unacceptable is
that it errors even if the string contains further characters and is
thus not a valid number; R5RS says that #f should be returned when the
string does not contain a syntactically valid number, and R7RS adds
explicitly that string->number never signals an error due to the
contents of the given string.
Apparently MIT/GNU Scheme has the same bug, as reported by 'ecraven'
on #scheme. From other systems I tested, Racket, Gauche, Gambit, and
Chibi return +inf.0 for numbers with a too high exponent; I'm told
Chicken also does so when the "numbers egg" is loaded.
Taylan
This bug report was last modified 1 year and 32 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.