Statement of the model

The CommonPoint system uses C++ mechanisms to handle the environment in a modular way across the scope of a block. Constructors implicitly save the current environment and optionally set new environment values. Destructors restore the saved environment, possibly in combination with whatever changes arose in the block. The model is this:

Numerical computation occurs within the context of an environment containing the rounding mode and exception flags. An environment class object encapsulates the environment within a block.

In the typical case, you instantiate an environment object in a block:

  1. The constructor saves the prior environment at the beginning of the block, optionally setting new state.
  2. Your application manipulates the environment through member functions.
  3. The destructor restores the prior environment, possibly in combination with the state at the block's end.
Although the abstraction provided by the CommonPoint environment classes simplifies manipulation of the environment, the underlying implementation is still registers in hardware. These terms help distinguish the abstraction from the implementation:

The environment convention

The cost of saving and restoring the environment across all functions that do any floating-point computation can be too high. To simplify use of the environment and lower its overhead, the CommonPoint environment model includes the convention:

Unless otherwise specified, a function is assumed to be called with rounding to nearest; it will not clear any exception flags raised at the time of its invocation, but might set flags according to its own behavior.


[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