What is IEEE754

Micael Coutinho,programmingieee

Learn here how your computer deals with floating-point operations and how to take advantage of it

I have a simple but often overlooked question for you: how does a computer, or any modern microcontroller represent floating-point numbers in the hardware? That's right, a question you have probably never asked yourself, but of extreme importance! Today, we will learn how the standard IEEE 754, for floating-point arithmetic, has defined floating-point numbers and what are the advantages that made IEEE choose this in detriment of something different.

Firstly, let's see what the standard is all about. It defines:

IEEE 754 is not the only way to represent floating-point numbers, but through time it has proven to be the most efficient. It's comprised of 3 parts:

When it comes to floating-point numbers, we are used to floats or double types. The differences start with the size: 32 bits for a float, 64 for a double, and the rest:

TypeSignExponentMantissaBias
float1 bit8 bits23 bits127
double1 bit11 bits52 bits1023

Lastly, let's take a look at the special values. These are values that need some extra care, because of their nature. They are:

Alright, now that you know how floating numbers are represented in hardware, we advise you to learn some cool new tricks, such as Quake's fast inverse square root, which is mind-boggling!

© AutosarToday —@LinkedIn