dvd2svcd
12th August 2003, 15:33
If I do this:
i=(150000 / 100 * 4)
MessageClip(String(i))
The result is 375 (Wrong should be 6000)
If I do this:
i=(150000 / 100) * 4
MessageClip(String(i))
The result is 6000 (Right)
If I do this:
i=150000 / (100 * 4)
MessageClip(String(i))
The result is 375 (Right)
If I do the first calculation in my calculator I get 6000. If I do it in Delphi I get 6000. And as far as I remember, * and / has the same priority and should always be calculated from left to right if no parenthesis is used.
i=(150000 / 100 * 4)
MessageClip(String(i))
The result is 375 (Wrong should be 6000)
If I do this:
i=(150000 / 100) * 4
MessageClip(String(i))
The result is 6000 (Right)
If I do this:
i=150000 / (100 * 4)
MessageClip(String(i))
The result is 375 (Right)
If I do the first calculation in my calculator I get 6000. If I do it in Delphi I get 6000. And as far as I remember, * and / has the same priority and should always be calculated from left to right if no parenthesis is used.