Trailing-Edge
-
PDP-10 Archives
-
SRI_NIC_PERM_FS_1_19910112
-
c/misc/float.core
There are no other files named float.core in the archive.
Floating point portability considerations
Any floating point routines have to be based on a core of
machine-dependent facilities. The question is what should this core
be composed of. Two such cores are described below.
No conclusions are (yet) drawn here. However, the fact that
the CARM descriptions exist suggests that they are apt to be more
"standard" or more widely supported than those of the PML (which appear
to be specific to the PML alone).
CARM: Harbison & Steele book, section 11.3
See the actual sections for full descriptions. Note that these
are the routines most likely to be machine dependent for efficiency;
it is probably possible to write some of them in terms
of a smaller core.
11.3.6 double ceil(x); Round up to integer.
11.3.12 double fmod(x,y); Return fractional part of x/y (remainder).
11.3.11 double floor(x) Round down to integer.
11.3.13 double frexp(x, nptr); Split mantissa & exponent.
11.3.15 double ldexp(x, n); Scale x by radix**n. Inverse of frexp.
11.3.18 double modf(x, nptr); Return fractional part of x.
PML: Portable Math Library, by Fred Fish.
Extracted from PML.DOC:
-----------------
There are currently only four highly machine dependent routines
in the Portable Math Library. When transporting the library to a new
machine, these should be the only ones in which recoding is necessary.
These routines, written in machine targeted C, are:
o dscale --- scale a double precision floating point number by a
specified power of two. Equivalent to multiplication or divi-
sion by a power of two, depending upon sign of the scale
value.
o dxexp --- extract exponent of double precision floating point
number and return it as an integer.
o dxmant --- extract mantissa of double precision floating point
number and return it as a double precision floating point
number.
o dint --- discard fractional part of double precision number,
returning integer part as a double precision floating point
number.
-------------------------