[C/C++] Attention! Integer-operation to avoid float-operation…

Using “integer type” has lots of merits against using “float type”
So, in some cases – especially in embedded system that uses ARM as their main MCU – we want to change float-operation into integer-operation by multiplying or shifting it.
Yes! It’s a good method in point of performance!
But we should take our careful attention to OVER/UNDERFLOW of integer-operation!!!
(In case of float-operation, in general, we are free from over/under flow!)

Keep in mind this.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s