I found this problem

w3label1.Caption := inttostr(150*(5 mod 10)); // should be 750 but it results in 0

w3label2.Caption := inttostr((5 mod 10)*150); // results in 750

They should both result in 750. However, the first one results in 0. I have let Jon know but he didn't think much could be done about it. I thought I would at least post it as a bug so people are aware of it.

# maths bug

Started by
Czar
, Aug 11 2017 10:38 PM

3 replies to this topic

### #3

Posted 11 August 2017 - 11:59 PM

It is the lack of being able to trust BEDMAS rules which is annoying. I can deal with the work-around but it took me about 30 minutes to figure out it was the equation resulting in 0 that was at fault when I was trying to figure out why the game wasn't working correctly. It should work out that (5 mod 10) first.

#### 0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users