Re: [SPAM] Re: [flexcoders] Re: decimal numbers in financial applications
Title: Re: [SPAM] Re: [flexcoders] Re: decimal numbers in financial applications Read the WIKI on floating multiplication particularly towards the bottom. Thats the reason why you get an error during arithmetic operations. 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: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Samuel D. Colak Sent: Thursday, August 17, 2006 3:58 PM To: flexcoders@yahoogroups.com 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 flexs use of the data type it is just inherent to all OSs. 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.9199289457264239899814128875732421875 * amount, the amount has to be over 50. 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. __,_._,___
RE: [SPAM] Re: [flexcoders] Re: decimal numbers in financial applications
You seem to be confused about integer data types versus floating-point data types. ActionScript supports three numeric data types: int: a signed 32-bit integer uint:: an unsigned 32-bit integer Number: a 64-bit floating-point number, the same as a double in Java ActionScript does not have a 64-bit integer type, or a 32-bit floating-point type (a float in Java). A Number/double takes up 64 bits, but the value 2^64 - 1 has no relevance to the Number type. A Number cannot even store this value exactly. 2^64 - 1 is the largest value that can be stored in an unsigned 64-bit integer data type. But that isn't what a Number is, and ActionScript doesn't have a 64-bit integer data type. Similarly, 2^32 - 1 is the largest value that can be stored in an 32-bit integer data type (uint). But it can't even be stored exactly by a float. - Gordon From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Samuel D. Colak Sent: Friday, August 18, 2006 12:27 AM To: flexcoders@yahoogroups.com Subject: Re: [SPAM] Re: [flexcoders] Re: decimal numbers in financial applications Read the WIKI on floating multiplication particularly towards the bottom. Thats the reason why you get an error during arithmetic operations. 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]com 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]ups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Samuel D. Colak Sent: Thursday, August 17, 2006 3:58 PM To: [EMAIL PROTECTED]ups.com 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 flexs use of the data type it is just inherent to all OSs. 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.9199289457264239899814128875732421875 * amount, the amount has to be over 50. 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 Software development tool Software development Software development services Home design software Software development company YAHOO! GROUPS
Re: [SPAM] Re: [flexcoders] Re: decimal numbers in financial applications
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 * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
Re: [SPAM] Re: [flexcoders] Re: decimal numbers in financial applications
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 takequite afew 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.9199289457264239899814128875732421875 * amount, the amount has to be over 50. 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 SPONSORED LINKS Software development tool Software development Software development services Home design software Software development company 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. __,_._,___
Re: [SPAM] Re: [flexcoders] Re: decimal numbers in financial applications
Title: 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 flexs use of the data type it is just inherent to all OSs. 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.9199289457264239899814128875732421875 * amount, the amount has to be over 50. 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 SPONSORED LINKS Software development tool Software development Software development services Home design software Software development company 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. __,_._,___
RE: [SPAM] Re: [flexcoders] Re: decimal numbers in financial applications
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: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Samuel D. Colak Sent: Thursday, August 17, 2006 3:58 PM To: flexcoders@yahoogroups.com 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 flexs use of the data type it is just inherent to all OSs. 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.9199289457264239899814128875732421875 * amount, the amount has to be over 50. 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 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. __,_._,___
Re: [SPAM] RE: [flexcoders] Re: decimal numbers in financial applications
We worked closely with many enterprise customers, including financial ones, during our development phase and beta period, and support for decimal arithmetic was not a priority for them. I've also read many thousands of FlexCoders and Beta list emails during the Flex 1, 1.5, and 2 cycles, and I recall only a handful raising this issue. The last app I worked on that dealt with money did all of the money calculations on the server side and used asynch calls to get pages of precalculated data for display. On the rare occasion that something needed to be calculated on the client, I just split the number at the decimal and dealt with each piece as an integer. 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 * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/