11.001001000011111101101010100010001000 Arithmazium
Home

Operations

Most programming environments provide the four rational functions:

The functional notation simplifies discussion of the operations below. It's common to program using infix expressions like x * y. One powerful alternative is the s-expression form (* x y) of Scheme and Lisp. There is even the postfix form of Forth: x y *.

IEEE Standard 754 defines several less obvious, but also useful functions:

Converting to and from floating point

Many programming environments have explicit integer data types. Converting to floating point from an integer type falls right into the pattern of any arithmetic operation. Converting from floating point to an integer type requires specification for values outside the range of integers, such as happens with huge values, \( \infty \), and NaN.

Converting between floating point and string formats depends on the environment. One of the attractions of decimal floating point is the lack of surprise converting between everyday decimal and internal decimal forms. Some environments support display in a radix other than decimal. These conversions usually appear in software that can handle the subtleties of formatting.

Many more operations

Any floating point system is going be a mix of hardware and software. The fastest systems are generally those with the most complete hardware support. But the conversation about floating point can be independent of how the features are implemented.

To fill out the discussion, here is the start of a bottomless list of floating point functions. Their implementation is usually in software. In the 1960s and 1970s, numerical software libraries were of highly variable quality. Since the arrival of IEEE 754, substantial effort has gone into refining these functions. Intel notably broke from convention by providing elementary function support on its 8087 and subsequent chips.

These common functions can be implemented in the same spirit as the carefully-specified arithmetic operations. Accuracy is another matter, as we will see.

The subtleties of rounding the transcendental functions and performing trigonometric argument reduction modulo \( \pi / n \) are topics all their own, but we will touch on them here.

Home