Contained WithinFind More DocumentationFeatured Support Resources | Descargar este libro en PDF (662 KB)
Appendix C Data RepresentationsWhatever the size of the data element in question, the most significant bit of the data element is always stored in the lowest-numbered byte of the byte sequence required to represent that object. This appendix is a brief introduction to data representation. For more in-depth explanations, see the Sun Fortran Programming Guide and Numerical Computation Guide. Real, Double, and Quadruple PrecisionReal, double precision, and quadruple precision number data elements are represented according to the IEEE standard by the following form, where f is the bits in the fraction. Quad is SPARC only. (-1)sign * 2exponent-bias *1.f Table C-1 Floating-point Representation
Extreme ExponentsThe representations of extreme exponents are as follows. Zero (signed)Zero (signed) is represented by an exponent of zero and a fraction of zero. Subnormal NumberThe form of a subnormal number is: (-1) sign * 2 1-bias *0.f where f is the bits in the significand. Signed InfinitySigned infinity--that is, affine infinity--is represented by the largest value that the exponent can assume (all ones), and a zero fraction. Not a Number (NaN)Not a Number (NaN) is represented by the largest value that the exponent can assume (all ones), and a nonzero fraction. Normalized REAL and DOUBLE PRECISION numbers have an implicit leading bit that provides one more bit of precision than is stored in memory. For example, IEEE double precision provides 53 bits of precision: 52 bits stored in the fraction, plus the implicit leading 1. IEEE Representation of Selected NumbersThe values here are as shown by dbx, in hexadecimal. Table C-2 IEEE Representation of Selected Numbers
Arithmetic Operations on Extreme ValuesThis section describes the results of basic arithmetic operations with extreme and ordinary values. We assume all inputs are positive, and no traps, overflow, underflow, or other exceptions happen. Table C-3 Extreme Value Abbreviations
Table C-4 Extreme Values: Addition and Subtraction
Note: Inf Inf and Inf + Inf = Inf ; Inf - Inf = NaN. Table C-5 Extreme Values: Multiplication
In the above table, NS means either Num or Sub result possible. Table C-6 Extreme Values: Division
Table C-7 Extreme Values: Comparison
Notes:
Bits and Bytes by ArchitectureThe order in which the data--the bits and bytes--are arranged differs between VAX computers on the one hand, and SPARC computers on the other. The bytes in a 32-bit integer, when read from address n, end up in the register as shown in the following tables. Table C-8 Bits and Bytes for Intel and VAX Computers
Table C-9 Bits and Bytes for 680x0 and SPARC Computers
The bits are numbered the same on these systems, even though the bytes are numbered differently. Following are some possible problem areas:
See also the man page, xdr(3N). |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||