Main Page   Modules   Data Structures   File List   Data Fields   Globals   Related Pages  

Math Library

Defines

Functions


Detailed Description

Origin: http://www.cise.ufl.edu/~cop4600/cgi-bin/lxr/http/source.cgi/lib/math/

Define Documentation

#define DBL_EXP_BIAS   1023
 

Exponent bias.

#define DBL_EXP_INFNAN   2047
 

#define DBL_MANT_DIG   53
 

DBL_MANT_DIG specifies the number of base FLT_RADIX digits in the mantissa part of a double.

#define DBL_MAX   1.7976931348623157E+308
 

DBL_MAX is the maximum value of a double.

#define DBL_MAX_EXP   +1024
 

DBL_MAX_EXP is the maximum value of base FLT_RADIX in the exponent part of a double.

#define DBL_MIN   2.2250738585072014E-308
 

DBL_MIN is the minimum value of a double.

#define DBL_MIN_EXP   -1021
 

DBL_MIN_EXP is the minimum value of base FLT_RADIX in the exponent part of a double.

#define DEG_TO_RAD  )     ((x) * 0.017453292519943295769236907684886)
 

From degree to radiant.

#define EDOM   0x01
 

EDOM - an input argument is outside the defined domain of the mathematical function.

#define ERANGE   0x03
 

ERANGE - the result of the function is too large (overflow) or too small (underflow) to be represented in the available space.

#define errno   (*__errno())
 

Integer variable errno, which is set by system calls and some library functions in the event of an error to indicate what went wrong.

#define FLT_RADIX   2
 

FLT_RADIX specifies the radix of the exponent representation.

#define HUGE_VAL
 

Value:

(__extension__                                                                                                                          \
        ((union { unsigned __l __attribute__((__mode__(__DI__))); double __d; })        \
        { __l: 0x7ff0000000000000ULL }).__d)
Some constants (Hart & Cheney).

#define M_1_PI   0.31830988618379067153776752674502872
 

The reciprocal of pi (1/pi).

#define M_1_SQRT2   0.70710678118654752440084436210484904
 

The reciprocal of the square root of two.

#define M_2_PI   0.63661977236758134307553505349005744
 

Two times the reciprocal of pi.

#define M_2PI   6.28318530717958647692528676655900576
 

Two times of pi.

#define M_3PI_4   2.35619449019234492884698253745962716
 

pi * 3 / 4

#define M_3PI_8   1.17809724509617246442349126872981358
 

pi * 3 / 8

#define M_4_PI   1.27323954473516268615107010698011488
 

Four times the reciprocal of pi.

#define M_E   2.71828182845904523536028747135266250
 

The base of natural logarithms.

#define M_EULER   0.57721566490153286060651209008240243
 

macros for constructing polynomials

#define M_LN10   2.30258509299404568401799145468436421
 

The natural logarithm of 10.

#define M_LN2   0.69314718055994530941723212145817657
 

The natural logarithm of 2.

#define M_LN_MAX_D   (M_LN2 * DBL_MAX_EXP)
 

#define M_LN_MIN_D   (M_LN2 * (DBL_MIN_EXP - 1))
 

#define M_LOG10E   0.43429448190325182765112891891660508
 

The logarithm to base 10 of M_E.

#define M_LOG2E   1.44269504088896340735992468100189213
 

The logarithm to base 2 of M_E.

#define M_PI   3.14159265358979323846264338327950288
 

Pi, the ratio of a circle?s circumference to its diameter.

#define M_PI_2   1.57079632679489661923132169163975144
 

Pi divided by two.

#define M_PI_4   0.78539816339744830961566084581987572
 

Pi divided by four.

#define M_PI_8   0.39269908169872415480783042290993786
 

Pi divided by eight.

#define M_SQRT2   1.41421356237309504880168872420969808
 

The square root of two.

#define POLYNOM1 x,
 )     ((a)[1]*(x)+(a)[0])
 

#define POLYNOM10 x,
 )     (POLYNOM9((x),(a)+1)*(x)+(a)[0])
 

#define POLYNOM11 x,
 )     (POLYNOM10((x),(a)+1)*(x)+(a)[0])
 

#define POLYNOM12 x,
 )     (POLYNOM11((x),(a)+1)*(x)+(a)[0])
 

#define POLYNOM13 x,
 )     (POLYNOM12((x),(a)+1)*(x)+(a)[0])
 

#define POLYNOM2 x,
 )     (POLYNOM1((x),(a)+1)*(x)+(a)[0])
 

#define POLYNOM3 x,
 )     (POLYNOM2((x),(a)+1)*(x)+(a)[0])
 

#define POLYNOM4 x,
 )     (POLYNOM3((x),(a)+1)*(x)+(a)[0])
 

#define POLYNOM5 x,
 )     (POLYNOM4((x),(a)+1)*(x)+(a)[0])
 

#define POLYNOM6 x,
 )     (POLYNOM5((x),(a)+1)*(x)+(a)[0])
 

#define POLYNOM7 x,
 )     (POLYNOM6((x),(a)+1)*(x)+(a)[0])
 

#define POLYNOM8 x,
 )     (POLYNOM7((x),(a)+1)*(x)+(a)[0])
 

#define POLYNOM9 x,
 )     (POLYNOM8((x),(a)+1)*(x)+(a)[0])
 

#define RAD_TO_DEG  )     ((x) * 57.295779513082320876798154814105)
 

From radiant to degree.


Function Documentation

int __IsNan double  d  ) 
 

Is Not-A-Number. Returns whether x is a NaN (Not-A-Number) value. The NaN values are used to identify undefined or non-representable values for floating-point elements, such as the square root of negative numbers or the result of 0/0.

Parameters:
d A floating-point value.
Returns:
A non-zero value (true) if x is a NaN value; and zero (false) otherwise.

double acos double  x  ) 
 

Compute arc cosine. Returns the principal value of the arc cosine of x, expressed in radians. In trigonometrics, arc cosine is the inverse operation of cosine.

Parameters:
x Value whose arc cosine is computed, in the interval [-1,+1]. If the argument is out of this interval, a domain error occurs.
Returns:
Principal arc cosine of x, in the interval [0,pi] radians. One radian is equivalent to 180/PI degrees.

double asin double  x  ) 
 

Returns the principal value of the arc sine of x, expressed in radians. In trigonometrics, arc sine is the inverse operation of sine.

Parameters:
x Value whose arc sine is computed, in the interval [-1,+1]. If the argument is out of this interval, a domain error occurs.
Returns:
Principal arc sine of x, in the interval [-pi/2,+pi/2] radians. One radian is equivalent to 180/PI degrees.

double atan double  x  ) 
 

Compute arc tangent. Returns the principal value of the arc tangent of x, expressed in radians. In trigonometrics, arc tangent is the inverse operation of tangent. Notice that because of the sign ambiguity, the function cannot determine with certainty in which quadrant the angle falls only by its tangent value.
See atan2 for an alternative that takes a fractional argument instead.

Parameters:
x Value whose arc tangent is computed.
Returns:
Principal arc tangent of x, in the interval [-pi/2,+pi/2] radians. One radian is equivalent to 180/PI degrees.

double atan2 double  y,
double  x
 

Compute arc tangent with two parameters. Returns the principal value of the arc tangent of y/x, expressed in radians. To compute the value, the function takes into account the sign of both arguments in order to determine the quadrant. If both arguments passed are zero, a domain error occurs.

Parameters:
y Value representing the proportion of the y-coordinate.
x Value representing the proportion of the x-coordinate.
Returns:
Principal arc tangent of y/x, in the interval [-pi,+pi] radians. One radian is equivalent to 180/PI degrees.

double ceil double  x  ) 
 

Round up value. Rounds x upward, returning the smallest integral value that is not less than x.

Parameters:
x Value to round up.
Returns:
The smallest integral value that is not less than x (as a floating-point value).

double cos double  x  ) 
 

Compute cosine. Returns the cosine of an angle of x radians.

Parameters:
x Value representing an angle expressed in radians. One radian is equivalent to 180/PI degrees.
Returns:
Cosine of x radians.

double cosh double  x  ) 
 

Compute hyperbolic cosine. Returns the hyperbolic cosine of x radians.

Parameters:
x Value representing an angle, expressed in radians.
Returns:
Hyperbolic cosine of x.

unsigned char crc7 unsigned char  crc,
const unsigned char *  buffer,
unsigned  len
 

Update the CRC7 for the data buffer.

Parameters:
crc previous CRC7 value
buffer Data pointer.
len Number of bytes in the buffer
Returns:
Updated CRC7 value.

double exp double  x  ) 
 

Compute exponential function. Returns the base-e exponential function of x, which is e raised to the power x: e^x.

Parameters:
x Value of the exponent.
Returns:
Exponential value of x.

double fabs double  x  ) 
 

Returns the absolute value of x: |x|.

Parameters:
x Value whose absolute value is returned.
Returns:
The absolute value of x.

double floor double  x  ) 
 

Round down value. Rounds x downward, returning the largest integral value that is not greater than x.

Parameters:
x Value to round down.
Returns:
The value of x rounded downward (as a floating-point value).

double fmod double  numer,
double  denom
 

Compute remainder of division. Returns the floating-point remainder of numer/denom (rounded towards zero):
fmod = numer - tquot * denom Where tquot is the truncated (i.e., rounded towards zero) result of: numer/denom.

Parameters:
numer Value of the quotient numerator.
denom Value of the quotient denominator.
Returns:
The remainder of dividing the arguments. If denom is zero, the function may either return zero or cause a domain error.

double frexp double  x,
int *  exp
 

Get significand and exponent. Breaks the floating point number x into its binary significand (a floating point with an absolute value between 0.5(included) and 1.0(excluded)) and an integral exponent for 2, such that:
x = significand * 2^exponent
The exponent is stored in the location pointed by exp, and the significand is the value returned by the function.
If x is zero, both parts (significand and exponent) are zero.
If x is negative, the significand returned by this function is negative.

Parameters:
x Value to be decomposed.
eptr Pointer to an int where the value of the exponent is stored.
Returns:
The binary significand of x. This value is the floating point value whose absolute value lays in the interval [0.5,1) which, once multiplied by 2 raised to the power of exp, yields x.

int iacos int  x,
int  hyp
 

Compute arc cosine, this the integer version normalized 0-10000.

Parameters:
x Value whose arc cosine is computed.
hyp Hypotenusa lenght (1-10000)
Returns:
Principal arc cosine of x (0-360)

int iasin int  y,
int  hyp
 

Compute arc sine, this the integer version normalized 0-10000.

Parameters:
y Value whose arc sine is computed.
hyp Hypotenusa lenght (1-10000)
Returns:
Principal arc sine of y (0-360)

int iatan int  y,
int  x
 

Compute arc tangent, this the integer version normalized 0-10000.

Parameters:
x Value whose arc tangent is computed.
y Value whose arc tangent is computed.
Returns:
Principal arc tangent (0-360)

int icos int  ix  ) 
 

Compute cosine, this the integer version normalized 0-10000.

Parameters:
ix Angle in degree 0-360
Returns:
cos of ix in the range 0-10000

int isfinite double  x  ) 
 

Is finite value. Returns whether x is a finite value.
A finite value is any floating-point value that is neither infinite nor NaN (Not-A-Number).

Parameters:
x A floating-point value.
Returns:
A non-zero value (true) if x is finite; and zero (false) otherwise.

int isin int  ix  ) 
 

Compute sine, this the integer version normalized 0-10000.

Parameters:
ix Angle in degree 0-360
Returns:
sin of ix in the range 0-10000

int isinf double  x  ) 
 

Is infinity. Returns whether x is an infinity value (either positive infinity or negative infinity).

Parameters:
x A floating-point value.
Returns:
A non-zero value (true) if x is an infinity; and zero (false) otherwise.

int isnan double  x  ) 
 

Is Not-A-Number. Returns whether x is a NaN (Not-A-Number) value.
The NaN values are used to identify undefined or non-representable values for floating-point elements, such as the square root of negative numbers or the result of 0/0.

Parameters:
x A floating-point value.
Returns:
A non-zero value (true) if x is a NaN value; and zero (false) otherwise.

unsigned int isqrt unsigned int  val  ) 
 

Compute square root.

Parameters:
val Value whose square root is computed.
Returns:
Square root of val

int itan int  ix  ) 
 

Compute tangent, this the integer version normalized 0-10000.

Parameters:
ix Angle in degree 0-360
Returns:
tan of ix in the range 0-10000

ldexp double  x,
int  exp
 

Generate value from significand and exponent. Returns the result of multiplying x (the significand) by 2 raised to the power of exp (the exponent).
lexpr(x,exp) = x * 2^exp.

Parameters:
x Floating point value representing the significand.
eptr Value of the exponent.
Returns:
The function returns: x * 2^exp

double log double  x  ) 
 

Compute natural logarithm. Returns the natural logarithm of x. The natural logarithm is the base-e logarithm: the inverse of the natural exponential function (exp). For common (base-10) logarithms, see log10.

Parameters:
x Value whose logarithm is calculated. If the argument is negative, a domain error occurs.
Returns:
Natural logarithm of x. If x is negative, it causes a domain error. If x is zero, it may cause a pole error

double log10 double  x  ) 
 

Compute common logarithm. Returns the common (base-10) logarithm of x.

Parameters:
x Value whose logarithm is calculated. If the argument is negative, a domain error occurs.
Returns:
Common logarithm of x. If x is negative, it causes a domain error. If x is zero, it may cause a pole error.

void memcpy char *  dst,
char *  src,
int  count
 

Copies the values of num bytes from the location pointed by source directly to the memory block pointed by destination.

Parameters:
src Pointer to the source of data to be copied, type-casted to a pointer of type const void *.
dst Pointer to the destination array where the content is to be copied, type-casted to a pointer of type void *.
count Number of bytes to copy.

void * memmove void *  dst,
void *  src,
int  count
 

Copies the values of count bytes from the location pointed by source to the memory block pointed by destination.

Parameters:
dst Pointer to the destination array where the content is to be copied, type-casted to a pointer of type void *.
src Pointer to the source of data to be copied, type-casted to a pointer of type const void *.
count Number of bytes to copy.

void memset char *  dst,
char  ch,
int  count
 

Copies the values of num bytes from the location pointed by source directly to the memory block pointed by destination.

Parameters:
dst Pointer to the block of memory to fill.
ch Value to be set.
count Number of bytes to be set to the value.

double modf double  x,
double *  ip
 

Break into fractional and integral parts. Breaks x into an integral and a fractional part. The integer part is stored in the object pointed by intpart, and the fractional part is returned by the function. Both parts have the same sign as x.

Parameters:
x Floating point value to break into parts.
ip Pointer to an object (of the same type as x) where the integral part is stored with the same sign as x.
Returns:
The fractional part of x, with the same sign.

double pow double  base,
double  exponent
 

Raise to power. Returns base raised to the power exponent:
base^exponent
.

Parameters:
base Base value.
exponent Exponent value.
Returns:
The result of raising base to the power exponent. If the base is finite negative and the exponent is finite but not an integer value, it causes a domain error. If both base and exponent are zero, it may also cause a domain error on certain implementations. If base is zero and exponent is negative, it may cause a domain error or a pole error (or none, depending on the library implementation). The function may also cause a range error if the result is too great or too small to be represented by a value of the return type.

double remainder double  numer,
double  denom
 

Compute remainder. Returns the floating-point remainder of numer/denom (rounded to nearest):
remainder = numer - rquot * denom
Where rquot is the result of: numer/denom, rounded toward the nearest integral value (with halfway cases rounded toward the even number). A similar function, fmod, returns the same but with the quotient truncated (rounded towards zero) instead.

Parameters:
numer Value of the quotient numerator.
denom Value of the quotient denominator.
Returns:
The remainder of dividing the arguments. If this remainder is zero, its sign shall be that of numer. If denom is zero, the function may either return zero or cause a domain error.

double sign double  x  ) 
 

Returns a value indicating the sign of a double-precision floating-point number.

Parameters:
x Floating point value.
Returns:
A number that indicates the sign of value: -1 if x < 0, 0 if x == 0, 1 if x > 0

int signbit double  x  ) 
 

Sign bit. Returns whether the sign of x is negative.

Parameters:
x A floating-point value.
Returns:
A non-zero value (true) if the sign of x is negative; and zero (false) otherwise.

double sin double  x  ) 
 

Compute sine. Returns the sine of an angle of x radians.

Parameters:
x Value representing an angle expressed in radians. One radian is equivalent to 180/PI degrees.
Returns:
Sine of x radians.

double sinh double  x  ) 
 

Compute hyperbolic sine. Returns the hyperbolic sine of x radians.

Parameters:
x Value representing an angle, expressed in radians.
Returns:
Hyperbolic sine of x.

double sqrt double  x  ) 
 

Compute square root.

Parameters:
x Value whose square root is computed. If the argument is negative, a domain error occurs.
Returns:
Square root of x.

double tan double  x  ) 
 

Compute tangent. Returns the tangent of an angle of x radians.

Parameters:
x Value representing an angle, expressed in radians. One radian is equivalent to 180/PI degrees.
Returns:
Tangent of x radians.

double tanh double  x  ) 
 

Compute hyperbolic tangent. Returns the hyperbolic tangent of x radians.

Parameters:
x Value representing an angle, expressed in radians. One radian is equivalent to 180/PI degrees.
Returns:
Hyperbolic tangent of x.


Generated on Tue Apr 7 20:07:45 2015 for BF592A Library by doxygen 1.3.1