Jump to content

maths bug


Recommended Posts

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.

Link to post
Share on other sites

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.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...