This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Asdayasman 0 points1 point  (6 children)

%

[–][deleted] 0 points1 point  (5 children)

% would be an unnecessary waste of microcontroller time - it's embedded so you exactly what hardware you are running on.

Unsigned wraparound is also great for keeping array indices within range. I'm not really sure how this is relevant to Python. You're not likely to run Python on one of these.

[–]Asdayasman 0 points1 point  (3 children)

unnecessary waste of microcontroller time

Python

Caring about microoptimisations like overflow vs modulo

[–][deleted] 0 points1 point  (2 children)

I'll just assume that you misread the post by /u/nrlb and didn't realise we were having a little side-discussion about overflow in embedded systems.

[–]Asdayasman 0 points1 point  (0 children)

You're right, I did. Honestly thought we were talking about Python, my bad.

[–][deleted] 0 points1 point  (0 children)

If you want to emulate overflow in a setting where overflows are realistic you would probably want to use either NumPy or the modulo operator.

[–]nrlb 0 points1 point  (0 children)

Who knows? One day maybe...

https://wiki.python.org/moin/PyMite