Re: [Flashcoders] Problems when converting to Number

2010-12-19 Thread Gerry Beauregard
You're getting to the limits of the precision of a Number. In ActionScript 3, the Number type is stored in binary, in 64-bit double-precision IEEE floating point format: http://en.wikipedia.org/wiki/Binary64 It uses 52 bits for the mantissa (fractional part) which gives it an effective

Re: [Flashcoders] Problems when converting to Number

2010-12-19 Thread Anthony Pace
Oh well, after reading a couple of articles, I think I have confirmed my suspicion; for, as I thought, it just comes down to there being too many digits, and the floating point implementation doing some hidden weirdness. It really sucks that you can really only expect about 15 digits of true

Re: [Flashcoders] Problems when converting to Number

2010-12-19 Thread Anthony Pace
Thanks for the response. Right as you were posting, I was posting my own message of how I read up on the spec, and saw the same thing. From what I have read, as you can't actually have the int portion be 9 999 999 999 999 999, because its limit is 9,007,199,254,740,992 , you can really only

Re: [Flashcoders] Problems when converting to Number

2010-12-19 Thread Henrik Andersson
Anthony Pace skriver: trace(Number('1992.2')); //why does it output 1992.3 //I am assuming I am missing something pretty obvious First it is parsed to binary floating point, losing accuracy and then it is output as decimal form again, losing accuracy again.

[Flashcoders] Problems when converting to Number

2010-12-18 Thread Anthony Pace
trace(Number('1992.2')); //why does it output 1992.3 //I am assuming I am missing something pretty obvious ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders