Simulator Bug 23/2=12

hippy

Ex-Staff (retired)
Welcome to the PICAXE Forum.

We will investigate this issue. There are other issues related to simulating division which we are working towards fixing and this may be related to those issues.
 

tjetson

Senior Member
When I try this, I get 11 as the answer. If I make it do 25/2, then the answer is given as 12. Is this something to do with the Picaxe integer maths thing?
 

hippy

Ex-Staff (retired)
Yes, 25 / 2 will be 12 because of PICAXE integer maths; decimal results are rounded down to the nearest integer value.

Divide by two on a PICAXE is a shift of the value, one bit to the right, the lsb bit is discarded.
 
Top