next up previous notation contents
Next: 2.6.3 Infinity Unveiled Up: 2.6 Extended Real Numbers Previous: 2.6.1 Hyperreal Numbers

2.6.2 Type Conversion

The three forms of floating point rounding are examples of type demotion. When a real number is rounded it is demoted into a relatively sparse system of numbers. Although the real number tex2html_wrap_inline32267 and the floating point number tex2html_wrap_inline32409 are incomparable, the two numbers may be compared by promotion via the natural homomorphisms, as follows:

math6447

There is a more compact syntax for describing type conversion. Any number may be converted to another type by attaching the target type. For example, tex2html_wrap_inline32493 specifies that the number a is converted to an extended real number. Type demotion can be more specific than promotion since there may be several ways to demote the number. Notice of promotion may be omitted as in the following example which adds three floating point numbers a, b, and c:

math6456

The inner promotions do not need to be mentioned since they can be inferred by the conversion from extended reals. The same addition using standard rounding could be specified as follows:

math6464

Since floating point addition is not strictly associative the order of addition should be specified. Strict bounds on the allowable error of particular floating point operator implementations will not be used in this presentation, so lax expression specification can be tolerated.


next up previous notation contents
Next: 2.6.3 Infinity Unveiled Up: 2.6 Extended Real Numbers Previous: 2.6.1 Hyperreal Numbers
Jeff TupperMarch 1996