Jump to content

Math Algorithm Bug

Recommended Posts

I just found a strange little bug in the math algorithm...

I tested these 2 lines of code:


print_num(24 - 21 + 1);

print_num(1 + 24 - 21);


They *should* both produce a result of 4, yet the first line subtracts the 1 instead of adding it and produces a result of 2. The second line works fine however.

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Create New...