Previous Section
 < Free Open Study > 
Next Section


C.5 The Header File cmath

In the math routines listed below, the following notes apply.

  1. Error handling for incalculable or out-of-range results is system dependent.

  2. All arguments and function return values are technically of type double (double-precision floatingpoint). However, single-precision (float) values may be passed to the functions.

acos(x)

  • Argument:

A floating-point expression x, where -1.0 x 1.0

  • Function return value:

Arc cosine of x, in the range 0.0 through π

asin(x)

  • Argument:

A floating-point expression x, where -1.0 x 1.0

  • Function return value:

Arc sine of x, in the range -π/2 through π/2

atan(x)

  • Argument:

A floating-point expression x

  • Function return value:

Arc tangent of x, in the range -π/2 through π/2

ceil(x)

  • Argument:

A floating-point expression x

  • Function return value:

"Ceiling" of x (the smallest whole number x)

cos (angle)

  • Argument:

A floating-point expression angle, measured in radians

  • Function return value:

Trigonometric cosine of angle

cosh(x)

  • Argument:

A floating-point expression x

  • Function return value:

Hyperbolic cosine of x

exp(x)

  • Argument:

A floating-point expression x

  • Function return value:

The value e (2.718...) raised to the power x

fabs(x)

  • Argument:

A floating-point expression x

  • Function return value:

Absolute value of x

floor(x)

  • Argument:

A floating-point expression x

  • Function return value:

"Floor" of x (the largest whole number x)

log(x)

  • Argument:

A floating-point expression x, where x > 0.0

  • Function return value:

Natural logarithm (base e) of x

log10(x)

  • Argument:

A floating-point expression x, where x > 0.0

  • Function return value:

Common logarithm (base 10) of x

pow(x, y)

  • Arguments:

Floating-point expressions x and y. If x = 0.0, y must be positive; if x 0.0, y must be a whole number

  • Function return value:

x raised to the power y

sin(angle)

  • Argument:

A floating-point expression angle, measured in radians

  • Function return value:

Trigonometric sine of angle

sinh(x)

  • Argument:

A floating-point expression x

  • Function return value:

Hyperbolic sine of x

sqrt(x)

  • Argument:

A floating-point expression x, where x 0.0

  • Function return value:

Square root of x

tan(angle)

  • Argument:

A floating-point expression angle, measured in radians

  • Function return value:

Trigonometric tangent of angle

tanh(x)

  • Argument:

A floating-point expression x

  • Function return value:

Hyperbolic tangent of x



Previous Section
 < Free Open Study > 
Next Section
Converted from CHM to HTML with chm2web Pro 2.85 (unicode)