Floating Point

Overview

The IEEE binary floating-point standard defines an encoding used to represent numbers of form

(1)s×M×2E

where s denotes the sign bit, M the significand, and E the exponent. The binary representation of floating-point numbers are segmented into three fields: the sign bit, the exponent field, and the fraction field. Furthermore, there are three classes these fields are interpreted with respect to:

The Bias in the first two forms is set to 2k11 where k denotes the number of bits that make up the exponent field.

Rounding

Because floating-point arithmetic can't represent every real number, it must round results to the "nearest" representable number, however "nearest" is defined. The IEEE floating-point standard defines four rounding modes to influence this behavior:

Arithmetic

Floating-point arithmetic operations (e.g. +f, f, etc.) are neither commutative nor associative. This is a consequence of representations being an approximation of the fractional values they are meant to represent and the corresponding rounding errors.

Powered by Forestry.md