> Normally this is guaranteed to 2^64 –1

 

The Number data type is based on the IEEE-754 double-precision standard. It uses 64 bits to store a floating point number.

 

However, only 52 bits are used for the binary significand; 11 are for the binary exponent, and 1 is for the sign. So it cannot store integers up to 2^64 -1 exactly; only up to 2^52 - 1. It can of course also store some integers (and non-integers) much larger than 2^64 - 1, such as 1e100.

 

- Gordon

 


From: [email protected] [mailto:[email protected]] On Behalf Of Samuel D. Colak
Sent: Thursday, August 17, 2006 3:58 PM
To: [email protected]
Subject: Re: [SPAM] Re: [flexcoders] Re: decimal numbers in financial applications

 


Guys,

FP precision is based upon the machine capabilities. Normally this is guaranteed to 2^64 –1 as FP is usually encoded using 2*32 bit registers on mac and on PC 32 bit. Big or Small Edian aside, the IEEE ratification is standard amongst all OS platforms however some have extended the format to cater for there own nuances.

Try http://www.psc.edu/general/software/packages/ieee/ieee.html

Now when you perform arithmetic on 2 DP numbers, there are some failures which occur. Check out http://en.wikipedia.org/wiki/Floating_point for why.

Regards
Samuel

PS. So it isnt a fault with flex’s use of the data type – it is just inherent to all OS’s.


On 17/8/06 23:20, "Anatole Tartakovsky" <anatole.tartakovsky@gmail.com> wrote:


 
 

Ryan,
With double, precision should not be an issue  - usually "money" datatype is limited to 18 digits and in most practical applications is limited to 11-12 digits. If you work with doubles (16+ correct digits) t would take quite a few operations to get precision under 12 digits. In terms of individual operations, in order to get 1 cent rounding error for the original case
 
1.9199999999999999289457264239899814128875732421875 * amount, the amount has to be over
      50000000000000.
 
You decide if it is practical or not
 
Regards,
Anatole


 
On 8/17/06, ryanm <[EMAIL PROTECTED]net> wrote:

> Apparently you acknowledge that it would work but need to keep BigDecimal
> for other reasons.
>
I get the impresson that they want some calculations to be done "real
time" on the client, and for that a BigDecimal object would be needed in the
client as well as on the server.

ryanm


 


 
    

 

__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




__,_._,___

Reply via email to