Octave Programming Tutorial/General mathematical functions

=General Mathematical Functions=

Constants

 * is the base of the natural logarithm.
 * without arguments returns the scalar e.
 * returns a square matrix of e of size.
 * where the arguments are dimensions of some matrix of e.
 * where  is an optional argument that specifies the return type,   or.


 * is the machine precision and returns the relative spacing between any floating point number and the next representable number. This value is system dependent.
 * returns the value of.
 * returns the spacing between X and the next value.
 * with more than one argument is treated like  with the matrix value being.


 * All of the constant functions listed are defined exactly like
 * is the ratio of the circumference to the diameter of any circle.
 * is the imaginary unit defined so.
 * is used for values that overflow the standard IEEE floating point range or the result of division by zero.
 * is used for various results that are not well defined or undefined. Note that  never equals other   values. Use the function   to check for.
 * is the largest floating point value representable.
 * is the smallest positive floating point value representable.

Arithmetic Functions

 * and  return the highest integer not greater than   or lowest integer not less than , respectively.
 * and  return the integer closest to   or truncate   towards zero, respectively.
 * and  returns x - y * fix( x ./ y ) or x - y * floor( x ./ y ), they are the same except when dealing with negative arguments.
 * returns the length of the hypotenuse of a right-angle triangle with the adjacent and opposite of size  and.
 * return absolute of x.
 * return sign of the x (-1, 0 or +1).

Ordinary Trigonometry

 * ,  and   — the elemental functions that we all know and love. They take their arguments in radians.
 * ,  are the inverses of   and   and are able to compute arguments not contained in the range [-1,1].
 * and  are the 2 available inverses of tan.   is a simple inverse whereas   takes 2 arguments and returns an angle in the appropriate quadrant. More information on   can be found here.
 * Note that one can add the character d to any of the functions except  and they will work in degrees rather than radians. For example:
 * , exponential funtion of x
 * , natural logarithmic of x, loge NOT log 10

Hyperbolic Trigonometry

 * ,  and   are analog to their more prosaic counterparts but deal with the unit hyperbola instead of the unit circle. They also take their arguments in radians.
 * ,  and   are the inverses of ,   and.
 * Unlike their circular uncles they cannot be made to take their arguments in degrees.