7 Math Functions

Table 7-1 lists and describes the math functions in the DEC C Run-Time Library (RTL). For more detailed information on each function, see the Reference Section.

Table 7-1 Math Functions

Function  Description 
abs  Returns the absolute value of an integer. 
acos  Returns a value in the range 0 to , which is the arc cosine of its radian argument. 
asin  Returns a value in the range -/2 to /2, which is the arc sine of its radian argument. 
atan  Returns a value in the range -pi /2 to /2, which is the arc tangent of its radian argument. 
atan2  Returns a value in the range -pi to , which is the arc tangent of y/x where y and x are the two arguments. 
cabs  Returns: sqrt ( x * x + y * y ). 
ceil  Returns (as a double) the smallest integer that is greater than or equal to its argument. 
cos  Returns the cosine of its radian argument. 
cot  Returns the cotangent of its radian argument. 
cosh  Returns the hyperbolic cosine of its argument. 
drand48, erand48, jrand48, lrand48, mrand48, nrand48   Generates uniformly distributed pseudorandom number sequences. Returns 48-bit, nonnegative, double-precision floating-point values. 
exp  Returns the base e raised to the power of the argument. 
fabs  Returns the absolute value of a floating-point value. 
floor  Returns (as a double) the largest integer that is less than or equal to its argument. 
fmod  Computes the floating-point remainder of the first argument to fmod divided by the second. 
frexp  Calculates the fractional and exponent parts of a double value. 
hypot  Returns the square root of the sum of the squares of two arguments. 
initstate   Initializes random number generators. 
labs  Returns the absolute value of an integer as a long int. 
lcong48   Initializes a 48-bit uniformly distributed pseudorandom number sequence. 
llabs, qabs (Alpha only)  Returns the absolute value of an __int64 integer. 
ldexp  Returns its first argument multiplied by 2 raised to the power of its second argument. 
ldiv, div  Returns the quotient and remainder after the division of their arguments. 
lldiv, qdiv (Alpha only)  Returns the quotient and remainder after the division of their arguments. 
log, log 10  Returns the logarithm of their arguments. 
modf  Returns the positive fractional part of its first argument and assigns the integral part, expressed as a double, to the object whose address is specified by the second argument. 
pow  Returns the first argument raised to the power of the second argument. 
rand, srand  Returns pseudorandom numbers in the range 0 to 231 - 1
random, srandom   Generates pseudorandom numbers in a more random sequence. 
seed48, srand48   Initializes a 48-bit random number generator. 
setstate  Restarts, and changes random number generators.  
sin  Returns the sine of its radian argument. 
sinh  Returns the hyperbolic sine of its argument. 
sqrt  Returns the square root of its argument. 
tan  Returns a double value that is the tangent of its radian argument. 
tanh  Returns a double value that is the hyperbolic tangent of its double argument. 


Previous Page | Next Page | Table of Contents | Index