A string doesn't equal itself
Bill Marriott
wjm at wjm.org
Thu Apr 12 17:25:29 EDT 2007
Joe,
> But Bill, did you notice THEY AREN'T THE SAME. ONE ENDS IN 1; THE OTHER
> ENDS IN 2!
>
>> put "3.141592653589793238461" is "3.141592653589793238462"
Um, yes, that was the point :) I think Rev handles up to 20 digits of
precision after the decimal point. So as the 1 and 2 are beyond its
precision, it considers the two (numeric) values equal. As numbers, they are
"equal"; as strings they are not.
FYI, Excel only gives you 14 digits of precision, so it would think
3.14159265358972222222 = 3.141592653589791111111 is "true."
Please no Microsoft jabs, I'm just trying to illustrate the #1 number
cruncher out there is not immune from these issues.
More information about the use-livecode
mailing list