[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.)
Davis
--
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
shipping.
- Inconsistency in `string-to-number',
Davis Herring <=
- Re: Inconsistency in `string-to-number', Eli Zaretskii, 2009/04/24
- Re: Inconsistency in `string-to-number', Juanma Barranquero, 2009/04/24
- Re: Inconsistency in `string-to-number', Stefan Monnier, 2009/04/24
- Re: Inconsistency in `string-to-number', Juanma Barranquero, 2009/04/24
- Re: Inconsistency in `string-to-number', Stefan Monnier, 2009/04/24
- Re: Inconsistency in `string-to-number', Juanma Barranquero, 2009/04/24