Real Component — A Brief Summary

 

Range of values: real numbers limited to about 15 digits of precision

Initial value: 0.0

 

Assignment operator: =

 

Arithmetic operators:

+          (addition)

-                     (subtraction)

*          (multiplication)

/           (real division — quotient and the remainder)

 

Precedence of arithmetic operator evaluation:

Highest:   parenthesized subexpressions

*, /

lowest:     +, -

Note: Consecutive operators of the equal precedence are evaluated left to right.

 

Relational operators:

==           (equal)

!=            (not equal)

<             (less than and not equal)

<=           (less than or equal)

>             (greater than and not equal)

>=           (greater than or equal)

 

Input and output:

Assume that input is an object of type Character_IStream, that output is an object of type Character_OStream, and that r is an object of type Real.

·        To input a value for r use input >> r.

·        To output the value of r use output << r.

 

Conversion operators:

Assume that r is an object of type Real.

·        To convert the value of r to a text string use To_Text (r).

·        To convert the value of r to an integer use To_Integer (r).

Note:    The result of To_Integer (r) is the "whole" part of r with the fractional part discarded.