Chapter 9. Unit C

Table of Contents
9.1. File C/Math
9.2. File C/Std

The C unit interfaces TOM with libc and libm.

9.1. File C/Math

The Math class wraps the standard mathematical functions present within libc.

class C.Math

Return the length of the hypotenuse of a right triangle whose sides measure x and y in length.

methods


double
  hypot (double, double) (x, y);

Undocumented.


double
  lgamma double x;

Undocumented.


double
  erf double x;

Undocumented.


double
  erfc double x;

Undocumented.


double
  j0 double x;

Undocumented.


double
  j1 double x;

Undocumented.


double
  jn (int, double) (x, n);

Undocumented.


double
  y0 double x;

Undocumented.


double
  y1 double x;

Undocumented.


double
  yn (int, double) (x, n);

Undocumented.


double
  acos double x;

Return the arc cosine of x. x must not fall outside the range -1 to 1. The return value will be in radians.


double
  asin double x;

Return the arc sine of x. x must not fall outside the range -1 to 1. The return value will be in radians.


double
  atan double x;

Return the arc tangent of x. The return value will be in radians.


double
  atan2 (double, double) (x, y);

Return the arc tangent of y/x, using the signs of the arguments to determine the quadrant of the return value. The return value will be in radians.


double
  cos double x;

Return the cosine of x. The return value will be in radians


double
  sin double x;

Return the sine of x. The return value will be in radians.


double
  tan double x;

Return the tangent of x. The return value will be in radians.


double
  cosh double x;

Return the hyperbolic cosine of x. The return value will be in radians.


double
  sinh double x;

Return the hyperbolic sine of x. The return value will be in radians.


double
  tanh double x;

Return the hyperbolic tangent of x. The return value will be in radians.


double
  exp double x;

Return the result of computing e^x.


double
  ldexp (double, int) (x, n);

Return the result of computing x * 2^n.


double
  log double x;

Return the natural log of x. x must be positive.


double
  log10 double x;

Return the log of x in base 10. x must be positive.


double
  pow (double, double) (x, y);

Return the value of x raised to the power y, x^y. If x is negative, y must be an integer value.


double
  sqrt double x;

Return the square root of x.


double
  ceil double x;

Return the value of x rounded up to the nearest integer.


double
  fabs double x;

Return the absolute value of x.


double
  floor double x;

Return the value of x rounded down to the nearest integer.


double
  fmod (double, double) (x, y);

Return the remainder of dividing x by y.

instance C.Math