MOO-cows Mailing List Archive
[Prev][Next][Index][Thread]
Re: Another floating point inconsistency thing...
In article <TCPSMTP.16.2.11.15.52.14.2239992234.209759@bbs.calbbs.com>,
<sysop@calbbs.com> wrote:
>;3.
>Line 1: syntax error
>1 error.
>;tofloat("3.")
>=> 3.0
>[used 2 ticks, 0 seconds.]
>
True, but it is harmless. The reason 3. is rejected in code is that
it is very difficult for the parser to determine if the "." is really
intended to be a decimal point or not (as opposed to a range, for
example). In the case of tofloat() there isn't anything else it
*could* be, so it seems it would be pretty silly to restrict it just
in order to throw a fit.
-hpa
--
PGP public key available - finger hpa@terminus.storm.net
"The earth is but one country, and mankind its citizens." -- Bahá'u'lláh
GE/CS 3.1 d- s-:- a- C++++ ULIS++++$ P+++ L++++>+++++ E++ W++ N++ o+ K
w--- O@ M V- PGP+ t+ 5++ X? R@ tv- b++ DI++++ D++(+) G e++ h- r-- y-
References:
Home |
Subject Index |
Thread Index