Next: Mixed Type Assignment
Up: Mixing Objects of Different
Previous: Mixing Objects of Different
In the CPU calculations must be performed between objects
of the same type, so
if an expression mixes type some objects must change type.
Default types have an implied ordering:
- INTEGER -- lowest
- REAL
- DOUBLE PRECISION
- COMPLEX -- highest
The result of an expression is always of the highest type,
for example,
- INTEGER * REAL gives a REAL, (3*2.0 is 6.0)
- REAL * INTEGER gives a REAL, (3.0*2 is 6.0)
- DOUBLE PRECISION * REAL gives DOUBLE PRECISION,
- COMPLEX * < anytype > gives COMPLEX,
- DOUBLE PRECISION * REAL * INTEGER gives DOUBLE PRECISION.
The actual operator is unimportant.
For more information, click here
Next: Mixed Type Assignment
Up: Mixing Objects of Different
Previous: Mixing Objects of Different
©University of Liverpool, 1997
Wed May 28 23:37:18 BST 1997Not for commercial use.