The Number data type, when including a decimal point is a binary floating point 
number and binary floating point math can result in rounding errors like yours. 

Adobe says this about Number:

"The Number data type uses the 64-bit double-precision format as specified by 
the IEEE Standard for Binary Floating-Point Arithmetic (IEEE-754) which means 
rounding errors can occur... The Number data type uses 52 bits to store the 
significand, with the result that numbers that require more than 52 bits to 
represent precisely, such as the fraction 1/3, are only approximations. If your 
application requires absolute precision with decimal numbers, you need to use 
software that implements decimal floating-point arithmetic as opposed to binary 
floating-point arithmetic."


On Feb 2, 2018, at 7:22 AM, Σπύρος Αγγελόπουλος <> 

Hi Everyone, 

Can anyone verify the results of calculation below ?

var n1:Number=18.9;

var n2:Number=100.0;              

var n3:Number=n1*n2;  //1889.9999999999998

is it bug ?



Reply via email to