Fixed so that "1/pivot" is rejected as a number, rather than dividing
by zero. Change: divide only if there is at least one denominator
digit.
This is not a good fix, but I need it now for some existing code. The
parser ought to be restructured not to compute the real part until it
is known that the imaginary part is valid, e.g.
(string->number "1/2+3") => #F
(string->number "1/0+3") => error
(string->number "1/0-transition") => error
There is a similar problem with exponent calculation:
(string->number "
1e9999e1") => error
(string->number "
1e99999999e1") => `hangs' in bignum primitives
Of course, the difficulty with these non-numbers is probably the
reason behind R4RS's restriction on valid identifiers. That is pretty
feeble, since I don't recall R4RS saying that STRING->NUMBER is
allowed to signal an error. Note that the current code would work
fine in a lazy language, so a few DELAYs and FORCEs might be the most
elegant fix (and OK effciency since FORCE is now compiled.)