GNU bug report logs - #18932
string->number errors on e.g. "1e400xyz"

Previous Next

Package: guile;

Reported by: taylanbayirli <at> gmail.com ("Taylan Ulrich Bayırlı/Kammer")

Date: Mon, 3 Nov 2014 09:22:02 UTC

Severity: normal

Full log


View this message in rfc822 format

From: taylanbayirli <at> gmail.com ("Taylan Ulrich Bayırlı/Kammer")
To: 18932 <at> debbugs.gnu.org
Subject: bug#18932: string->number errors on e.g. "1e400xyz"
Date: Mon, 03 Nov 2014 10:20:58 +0100
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.