# Floating Point/Special Numbers

## Special Numbers[edit]

There are several special numbers specified in the IEEE 754 standard. These include representations for zero, infinity, and Not-A-Number (NaN).

## Zero[edit]

A floating point number is said to be zero when the exponent and the significand are both equal to zero. This is a special case, because we remember that the significand is always considered to be normalized. This means that , and there is an implied "1." before the significand. If we look at the following equation:

And we plug in our values for m and e:

We say that whenever the exponent is zero, we have a special class of numbers called "denormalized numbers". We will discuss denormalized numbers more later.

### Negative Zero?[edit]

Notice that our definition of zero doesnt have any mention of the sign bit. This means that we can have both a positive zero, and a negative zero, depending on the sign value. What is the difference between the two? In general, there is no difference between positive zero and negative zero, except that the sign bit can propagate though arithmetic operations.

## Infinity[edit]

When the exponent of the number is the maximum value, that is, when the exponent is all 1 bits, we have another special class of numbers. This means that regular numbers may never use the maximum exponent value for representing numbers. If the exponent is the maximum value, and the significand is zero, we say that this special case is called "Infinity". Notice that we can have negative infinity and positive infinity values, depending on the sign bit.

## NaN[edit]

If we have a maximum exponent value, and a non-zero significand, we have a very special number known as **NaN**. NaN stands for "Not a Number", and occurs when we perform certain illegal operations, such a division by zero. NaN can be signed, but the sign rarely matters. NaN numbers cannot be used meaningfully in calculations.

## Cases[edit]

Type | Exp | Fraction | Sign |
---|---|---|---|

Positive Zero | 0 | 0 | 0 |

Negative Zero | 0 | 0 | 1 |

Denormalised numbers | 0 | non zero | any |

Normalised numbers | any | any | |

Infinities | 0 | any | |

NaN | non zero | any |