Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

7
  • I think the standard is that it is undefined for integer math. The floating point is according to the IEEE standard and returns a nan, but no exception. Catching an exeption in the Arduino is not possible (I think) : stackoverflow.com/questions/10095591/… When you find strange things with a byte, please give a full sketch that we can try and tell us which arduino board you use. Commented Nov 28, 2018 at 19:48
  • @Jot This is an interesting point but why would a nan be replaced with 4294967295. Apparently they don't have the same binary value. Why did Atmel not include a nan value (that maybe could be disabled through fuses) in their processor architecture. This is a useful troubleshooting feature that is heavily used in all major programming languages. Commented Nov 28, 2018 at 19:53
  • @Jot I used an Arduino nano with an Atmega 328p on board. Commented Nov 28, 2018 at 19:54
  • An integer can not be a 'nan', that is specified for floating point. Please update your question with board and microcontroller, and perhaps a full sketch. Commented Nov 28, 2018 at 19:57
  • I tried to make a sketch myself, and I have different results. Please show your sketch and tell us the results of the sketch that you show. Are you running this in a simulator? Commented Nov 28, 2018 at 20:04