No need to test on the nano, just making sure you were using an 8-bit processor. There are some 32-bit boards that might default to larger integers for their math.
ok, but it still doesn't explain why mine didn;t need the L after the numbers. Odd.
Hi,
On the Arduino Due and SAMD based boards (like MKR1000 and Zero), an int stores a 32-bit (4-byte) value. This yields a range of -2,147,483,648 to 2,147,483,647 (minimum value of -2^31 and a maximum value of (2^31) - 1).
Tom...
![]()
* != +
(Why did it take until reply #19 to find out the board being used?)
Post the exact code you are testing with.
cant realy, its too big. And lot of stuff that is irrelevant, like wifi, card readers etc.
I think it down to this equation that works:
in1=(a0 * 4620)/(1032 - a0);
in1 and a0 are both unsigned long
That explains why it worked for you. Your 4620 and 1032 are both being promoted to unsigned long because math is done on them with an unsigned long value.