2

I was trying to argue about the operation of a routine called micros() and millis() that is used on the Arduino platform, and I ended up finding this calculator. The calculator shows a different result than 8-bit (ATmega328 - Arduino Nano) and 32-bit (ESP32) processors. They even cited the result of the Windows calculator, which shows the same result as the aforementioned microcontrollers.

Nano/ESP32: 0x1 - 0xFFFFFF00 = 0x101

Calculator: 0x1 - 0xFFFFFF00 = 0xFFFFFEFF

I found an explanation for calculating subtraction for 8-bit numbers,

Does anyone know of an answer made with 32-bit numbers?.

R R
  • 21
  • 1
  • 1
    Is 0xFFFFFF00 supposed to be 4294967040 or -256? – Igor Skochinsky Aug 05 '22 at 23:38
  • @IgorSkochinsky, Hi, this is my doubt. Apparently, a microcontroller accepts one thing, but a calculator accepts something else. They commented that in Linux the result is the same as in the microcontroller, so I ended up not being able to argue anymore. – R R Oct 06 '22 at 06:08

0 Answers0