Most numerical functions are available in single, double, and extended (x86) or quadruple precision. Examples of calling different precision versions of various functions from different languages are shown in Table 3–4.
|
In C, names of single precision functions are formed by appending f to the double precision name, and names of extended or quadruple precision functions are formed by adding l. Because Fortran calling conventions differ, libsunmath provides r_…, d_…, and q_… functions for single, double, and quadruple precision, respectively. Fortran intrinsic functions can be called by the generic name for all three precisions.
Not all functions have q_… versions. Refer to math.h and sunmath.h for names and definitions of libm and libsunmath functions.
In Fortran programs, remember to declare r_… functions as real, d_… functions as double precision, and q_… functions as REAL*16. Otherwise, type mismatches might result.