As I said, usually FP is 2^64-1 (double precision) - single is 2^32-1 and used most of the time unless specified – hence long (datatype) single (datatype) under c/c#/c++.
Since flash (I believe) was coded ontop of c++, it depends on the mapping between datatypes as to which one prevails most of the time. Long / double precision numbers take a hell of a lot of cpu processing (hence the release of celeron processors of intel using a less intensive FPU) – I could understand why its not the default type.
Matt – the datatype NUMBER – how is this translated into a datatype such as long etc?
Regards
Samuel
On 18/8/06 03:54, "Gordon Smith" <[EMAIL PROTECTED]> wrote:
> 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" <[EMAIL PROTECTED]> 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]> 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
YAHOO! GROUPS LINKS
- Visit your group "flexcoders" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
__,_._,___

