I'm going crazy!
. . .
Why? Why? Why? Why? Why?
You are performing math operations on integers, and only after the operations are complete, the integer is cast to a double. See Typecasting.
Just use a double in the calculation.
Try:
double za = 100*67/750.0, zb = 100*142/250.0; Alert(DoubleToString(za,2), " ", DoubleToString(zb,2));
(Notice that I used 750.0 instead of 750 and 250.0 instead of 250)
double za = 100*67/750, zb = 100*142/250;
The program shows me: za = 8.00 and zb = 56.00
You are performing math operations on integers, and only after the operations are complete, the integer is cast to a double. See Typecasting.
Just use a double in the calculation.
Try:
(Notice that I used 750.0 instead of 750 and 250.0 instead of 250)
Really thanks to all!
The program shows me: za = 8.00 and zb = 56.00
instead my calculator displays: za = 8.93 and zb = 56.80
Why? Why? Why? Why? Why?