You're correct that ActionScript 3 has no 64-bit integer data type.
JavaScript / ECMAScript has the same limitation.
 
I'm afraid that if you need to store very large integers, you'll need to
use a datatype like String or ByteArray. If you need to do arithmetic
with these, you'll need to write your own AS3 routines or do the
arithmetic on the server.
 
- Gordon

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Adam Dorritie
Sent: Wednesday, January 10, 2007 8:18 AM
To: [email protected]
Subject: Re: [flexcoders] Re: 64-bit Integers



On 1/9/07, michael_ramirez44 <[EMAIL PROTECTED]
<mailto:michael_ramirez44%40yahoo.com> > wrote:
> The 64-bit integer limitation is an Actionscript 3 limit not Flex.
> The Number data type uses the 64-bit double-precision format as
> specified by the IEEE Standard for Binary Floating-Point Arithmetic
> (IEEE-754). This standard dictates how floating point numbers are
> stored using the 64 available bits. One bit is used to designate
> whether the number is positive or negative. Eleven bits are used for
> the exponent, which is stored as base 2. The remaining 52 bits are
> used to store the significand (also called the mantissa), which is
> the number that is raised to the power indicated by the exponent.

Michael,

Thank you for providing that section of the manual for me to read.
Although I had not read it before, I was familiar with the allocation
of bits in the Number data type. My concern is that, in effect, what
the Number data type provides for integers is a assurance of precision
only up to the 52 bits provided for the significand (with a 53rd
holding the sign).. As the manual states:

When you store integer values with the Number data type, only the 52
bits of the significand are used. The Number data type uses these 52
bits and a special hidden bit to represent integers from
-9,007,199,254,740,992 (-253) to 9,007,199,254,740,992 (253).

Unfortunately, that leaves me a few bits short. It may be that
internally AS handles these values in a way which renders my concern
unnecessary, but I though I would ask.


 

Reply via email to