Question
How to deal with Integer Overflow?
Posted on September 03, 2014 at 04:43
For evaluation purposes I got the STM32F0 discovery kit (STM32F030R8T6) with Cortex-M0, and I am using it with the IAR embedded workbench.
From the datasheet I know it has no FPU, which is what I need. In my project, in my C program, if I want to use only uint32 variables, can anyone tell me how to deal with theinteger overflow
when I go above thefixed-width
, and avoid thewrap-around
? I know one solution might besaturation arithmetic
, I wonder if there is a library for this. Any other way? Thanks Eli Jim #integer-overflow #confused! #bound-check