Sun Microsystems Logo
Products and Services
 
Support and Training
 
 

Sun ONE Studio 7, Compiler Collection
(formerly Forte Compiler Collection 7)
Interval Arithmetic
Sun ONE Studio 7, Compiler Collection
   »  Data Sheet
   »  Features & Benefits
   »  System Requirements
   »  Compatibility
   »  General FAQs
   Interval Arithmetic
 
 

What Is Interval Arithmetic?

An interval is the set of all real numbers between and including the interval's lower and upper bound. Interval arithmetic is used to evaluate arithmetic expressions over sets of numbers contained in intervals. Any interval arithmetic result is a new interval that is guaranteed to contain the set of all possible resulting values.

Interval arithmetic operations and mathematical functions form a closed mathematical system. This means that valid results are produced for any possible operator-operand combination, including division by zero and other indeterminate forms involving zero and infinities.

See also our feature story on Interval Arithmetic.

 
Table of Contents
 
 
 
 

Sun ONE Studio 7, Compiler Collection Fortran 95 Interval Arithmetic Support

The Sun ONE Studio 7, Compiler Collection Fortran 95 compiler contains the following interval features and extensions:

  • Full support for extended interval data type.
  • Valid results for any possible operator-operand combination, including division by zero and other indeterminate forms involving zero and infinities due to the fact that interval arithmetic operations and intrinsic mathematical functions form a closed system.
  • Interval versions of all Fortran 95 intrinsic operators and functions that accept real arguments.
  • A number of interval-specific intrinsic operators and functions, including:
    • interval-specific relational operators
    • set-theoretic intrinsic operators
    • mixed-mode expression evaluation
    • full input/output support

For more information about Fortran 95 Interval Arithmetic, see the Fortran 95 Interval Arithmetic Programming Reference.

Back to top
 
 

Sun ONE Studio 7, Compiler Collection C++ Interval Arithmetic Support

The Sun ONE Studio 7, Compiler Collection release provides a C++ version of the interval functions and operators that are contained in Fortran 95 Interval Arithmetic.

Interval Arithmetic support for C++ provides a C++ header file and library that implements three interval classes, one each for float, double, and long double.

The interval classes include:

  • Interval arithmetic operations and mathematical functions that form a closed mathematical system. This means that valid results are produced for any possible operator-operand combination, including division by zero and other indeterminate forms involving zero and infinities.
  • Three types of interval relational functions:
    • Certainly
    • Possibly
    • Set
  • Interval-specific functions, such as intersect and interval_hull
  • Interval-specific functions, such as inf, sup, and wid
  • Interval input/output, including single-number input/output

For more information about the C++ interval arithmetic library, see the C++ Interval Arithmetic Programming Reference.

Back to top
 
 

Interval Arithmetic Code Examples

Fortran 95 Interval Arithmetic Code Examples

With the Sun ONE Studio Fortran 95 compiler, it is a simple matter to write interval programs to compute rigorous bounds on the value of arithmetic expressions:

  • Declare variables to be type INTERVAL.
  • Write normal Fortran code using the intrinsic INTERVAL functions, operators, relational operators, and format edit descriptors.
  • Compile code using the -xia command-line option.

To achieve the best results, use existing interval algorithms that compute narrow width interval results. Devising algorithms to compute narrow interval results is the topic of interval analysis. See below for information on interval algorithms included with the F95 compiler. For more information, see the Interval Arithmetic Programming Reference.

C++ Interval Arithmetic Code Examples

Back to top
 
 

Where Can I Get More Information?

Back to top