that's bad!

The same in 3,0 SP1.
Seem that ibelongs to the number of decimals:

real a1,a2,a3; 

a1 = 8 / 24 * 3;
a2 = 8 / 24 * 3; 

a3 = a1 +a2;
info(strfmt("a1 +a2 = %1",a3)); 

a3 = 0.9999999999999999 + 0.9999999999999999;
info(strfmt("0.9999999999999999 + 0.9999999999999999 = %1",a3)); 

a3 = 0.999999999999999 + 0.999999999999999;
info(strfmt("0.999999999999999 + 0.999999999999999 = %1",a3)); 


a3 = 0.99999999999999999 + 0.99999999999999999;
info(strfmt("0.99999999999999999 + 0.99999999999999999 = %1",a3));
}

In Sp6 it works correct!


Michael



From: Stefan 
Sent: Tuesday, November 18, 2008 6:12 PM
To: [email protected] 
Subject: [development-axapta] Calculation error in AX3.0SP3


Hi,

I have the following code fragment:

real a1,a2,a3;

a1=8.0/24.0*3.0;
a2=8.0/24.0*3.0;

a3=a1+a2;

print a3;


In AX3.0SP3 I get 1.0 as a result which is definitely wrong. Is this a
known error? What is the extent of it - under what circumstances does
this happen?

Stefan



 

[Non-text portions of this message have been removed]

Reply via email to