[Top][All Lists]

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

Inconsistency in `string-to-number'

From: Davis Herring
Subject: Inconsistency in `string-to-number'
Date: Thu, 23 Apr 2009 17:16:45 -0700 (PDT)
User-agent: SquirrelMail/1.4.8-5.3.lanl4

(string-to-number "1:") => 1
(string-to-number "1.2:") => 1
(string-to-number "1.2") => 1.2

Because of the call to isfloat_string in Fstring_to_number, the lenience
shown integers is not extended to floats, with the bizarre result that the
function succeeds but ignores part of its input.

Should there be a lenient form of isfloat_string that suppresses the check
for whitespace or NUL after the float, or is this not part of
string-to-number's "documented behavior"?  (It isn't actually documented
either to allow garbage after ints or to forbid it after floats.)


This product is sold by volume, not by mass.  If it appears too dense or
too sparse, it is because mass-energy conversion has occurred during

reply via email to

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