Specifying floating-point functions

Chapter 9 explained the CommonPoint computational model and its relevance to the library of global floating-point functions. This chapter explains each function, with special attention to exceptional cases outside the strict domain of real numbers. If you know the mathematical properties of a particular function, you might find the special case information redundant, since it is determined by the computational model.

Consider, for example, the natural logarithm. For positive, finite arguments, the library function Log matches the mathematical function log to within platform-dependent rounding errors. Its special cases are:

  1. Log returns a NaN and raises invalid for , because is undefined there.
  2. Log returns and raises the divide-by-zero flag (to indicate the finite singularity) at the argument because . By convention, it behaves the same at .
  3. Log returns at the argument , because .
It is by convention, and in the spirit of at zero, that functions like Log raise the divide-by-zero flag at finite singularities. Whenever a function raises the invalid flag and the result is of floating-point type, the function returns a NaN; when the result is of integral type, the function returns a platform-dependent integral value.

Note that despite its limits at zero and , Log never overflows. The value of Log at the maximum double value is under 710. Log doesn't underflow, either, because of the relative sparsity of floating-point numbers near 1. The fact that is nearly x for small x says that the value of Log at the double number just larger than 1 is approximately .


[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.

Generated with WebMaker