Version 1.0
IRIS WORKSTATION GUIDE 91
Appendix E:
• When a float is passed as an argument to a function, it must be
extended to double.
• An arithmetic operation performed on
float
’s is done by first
extending the operands to
double
’s. After the operation is
performed, the result is truncated to
float
.
The implementation of floating point in C on the IRIS Workstation defines the
C types
double
and
float
to be the same precision - that of single precision. This
decision was made on the following basis:
• Many of the operations performed on the IRIS Workstation provide
results destined for the Geometry Engine pipeline. Since the
precision of Geometry Engine format floating point is somewhat less
than that of IEEE floating point single precision, it is inefficient to
perform all floating point operations in double precision.
• There are many calculations in which double precision is not
needed.
• Since conversion between single and double precision is expensive
in IEEE format, passing
float
’s between routines is inefficient if they
must be extended to double precision. This problem is amplified
when the receiving routine does not want the added precision and
converts the incoming value back to
float
.
All floating point numbers that are declared as either
double
or
float
will be
single precision on the IRIS Workstation. All operations on them will also be
single precision. This includes most calls to the standard set of math routines -
sin
,
cos
,
sqrt
, etc. See Section 3 of the
UNIX Programmer’s Manual
for an exact list.
The special type combination
long float
can be used to specify double precision
where it is needed. This implementation differs from the C standard since the
types
long float
and
double
are not synonymous.
NOTE: to write portable code with double-precision floating point, use the
type
long float
instead of
double
.
This implementation has several nice properties:
• Current C programs that use
float
’s and
double
’s will compile without
alteration, although
double
will be single precision.
• C programs will execute correctly under other implementations,
since
long float
is usually synonymous with
double
, so long as
double
’s
and
long float
’s are not intermixed.
• Single-precision math routines (
exp
,
sin
, etc.) can now be used.
These offer significant speed improvements over the double-
precision versions for those applications that do not require the extra
precision.
Summary of Contents for IRIS Workstation
Page 1: ...IRIS Workstation Guide Version 1 0 Silicon Graphics Inc Mountain View California 94043 ...
Page 6: ...2 IRIS WORKSTATION GUIDE Version 1 0 Introduction ...
Page 24: ...20 IRIS WORKSTATION GUIDE Version 1 0 Hardware Installation ...
Page 30: ...26 IRIS WORKSTATION GUIDE Version 1 0 Operation ...
Page 48: ...44 IRIS WORKSTATION GUIDE Version 1 0 System Administration ...
Page 50: ...46 IRIS WORKSTATION GUIDE Version 1 0 Appendix A ...
Page 74: ...70 IRIS WORKSTATION GUIDE Version 1 0 Appendix B ...
Page 77: ...Version 1 0 IRIS WORKSTATION GUIDE 73 Appendix C e random gr error f wnrepaint ...
Page 78: ...74 IRIS WORKSTATION GUIDE Version 1 0 Appendix C ...
Page 92: ...88 IRIS WORKSTATION GUIDE Version 1 0 Appendix D ...
Page 102: ...98 IRIS WORKSTATION GUIDE Version 1 0 Appendix E ...
Page 103: ...Appendix F Manual Pages ...
Page 104: ......
Page 131: ...Version 1 0 126 IRIS WORKSTATION GUIDE Appendix F ...
Page 132: ......
Page 136: ...130 IRIS WORKSTATION GUIDE Version 1 0 Appendix H ...
Page 152: ...146 IRIS WORKSTATION GUIDE Version 1 0 Appendix J ...