Sun Studio 12: Fortran Library Reference

## 1.3.1 Single-Precision Functions

These subprograms are single-precision math functions and subroutines.

In general, the functions below provide access to single-precision math functions that do not correspond to standard Fortran generic intrinsic functions—data types are determined by the usual data typing rules.

These functions need not be explicitly typed with a REAL statement as long as default typing holds. (Names beginning with “r” are REAL, with “i” are INTEGER.)

For details on these routines, see the C math library man pages (3M). For example, for r_acos(x) see the acos(3M) man page.

Table 1–2 Single-Precision Math Functions

Function Name

Return Type

Description

r_acos( x )

r_acosd( x )

r_acosh( x )

r_acosp( x )

r_acospi( x )

REAL

REAL

REAL

REAL

REAL

arc cosine

--

arc cosh

--

--

r_atan( x )

r_atand( x )

r_atanh( x )

r_atanp( x )

r_atanpi( x )

REAL

REAL

REAL

REAL

REAL

arc tangent

--

arc tanh

--

--

r_asin( x )

r_asind( x )

r_asinh( x )

r_asinp( x )

r_asinpi( x )

REAL

REAL

REAL

REAL

REAL

arc sine

--

arc sinh

--

--

r_atan2( y, x )

r_atan2d( y, x )

r_atan2pi( y, x )

REAL

REAL

REAL

arc tangent

--

--

r_cbrt( x )

r_ceil( x )

r_copysign( x, y )

REAL

REAL

REAL

cube root

ceiling

--

r_cos( x )

r_cosd( x )

r_cosh( x )

r_cosp( x )

r_cospi( x )

REAL

REAL

REAL

REAL

REAL

cosine

--

hyperb cos

--

--

r_erf( x )

r_erfc( x )

REAL

REAL

err function

--

r_expm1( x )

r_floor( x )

r_hypot( x, y )

r_infinity( )

REAL

REAL

REAL

REAL

(e**x)-1

floor

hypotenuse

--

r_j0( x )

r_j1( x )

r_jn(n, x )

REAL

REAL

REAL

Bessel--

--

ir_finite( x )

ir_fp_class( x )

ir_ilogb( x )

ir_irint( x )

ir_isinf( x )

ir_isnan( x )

ir_isnormal( x )

ir_issubnormal( x )

ir_iszero( x )

ir_signbit( x )

INTEGER

INTEGER

INTEGER

INTEGER

INTEGER

INTEGER

INTEGER

INTEGER

INTEGER

INTEGER

--

--

--

--

--

--

--

--

--

--

r_addrans( x, p, l, u )

r_lcran()

r_lcrans( x, p, l, u )

r_shufrans(x, p, l, u)

REAL

subroutineREAL

subroutine

subroutine

randomnumbergenerators

r_lgamma( x )

r_logb( x )

r_log1p( x )

r_log2( x )

REAL

REAL

REAL

REAL

log gamma

--

--

--

r_max_normal()

r_max_subnormal()

r_min_normal()

r_min_subnormal()

r_nextafter( x, y )

r_quiet_nan( n )

r_remainder( x, y )

r_rint( x )

r_scalb( x, y )

r_scalbn( x, n )

r_signaling_nan( n )

r_significand( x )

REAL

REAL

REAL

REAL

REAL

REAL

REAL

REAL

REAL

REAL

REAL

REAL

r_sin( x )

r_sind( x )

r_sinh( x )

r_sinp( x )

r_sinpi( x )

REAL

REAL

REAL

REAL

REAL

sine

--

hyperb sin

--

--

r_sincos( x, s, c )

r_sincosd( x, s, c )

r_sincosp( x, s, c )

r_sincospi( x, s, c )

subroutine

subroutine

subroutine

subroutine

sine & cosine

--

--

--

r_tan( x )

r_tand( x )

r_tanh( x )

r_tanp( x )

r_tanpi( x )

REAL

REAL

REAL

REAL

REAL

tangent

--

hyperb tan

--

--

r_y0( x )

r_y1( x )

r_yn( n, x )

REAL

REAL

REAL

bessel

--

--

• Variables c, l, p, s, u, x, and y are of type REAL. Variable n is of type INTEGER.

• Type these functions as explicitly REAL if an IMPLICIT statement is in effect that types names starting with “r” to some other date type.

• sind(x), asind(x), … take degrees rather than radians.

See also: intro(3M) and the Numerical Computation Guide.