| Samsung Internal API reference 2.0

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

Macros | Functions
Math library API

## Macros
#define | NAN __builtin_nan("")
#define | INFINITY __builtin_inf()
#define | isnan(x) _isnan(x)
#define | isfinite(x) _isfinite(x)
#define | M_E 2.7182818284590452354
#define | M_PI 3.14159265358979323846
#define | M_PI_2 1.57079632679489661923
#define | M_PI_4 0.78539816339744830962
#define | FP_ILOGBNAN (-1-(int)(((unsigned)-1)>>1))
#define | FP_ILOGB0 FP_ILOGBNAN

## Functions
_const_ double | atan (double x)
| Arc tangent function. More...
_const_ float | atanf (float x)
| Arc tangent function. More...
_const_ double | atan2 (double y, double x)
| Arc tangent function of two variables. More...
_const_ float | atan2f (float y, float x)
| Arc tangent function of two variables. More...
_const_ double | ceil (double x)
| ceiling function: smallest integral value not less than argument More...
_const_ float | ceilf (float x)
| ceiling function: smallest integral value not less than argument More...
_const_ double | pow (double base, double exp)
| Calculate the exponentiation. More...
_const_ float | powf (float base, float exp)
| Calculate the exponentiation. More...
_const_ double | sqrt (double x)
| Calculate the square root of x. More...
_const_ float | sqrtf (float x)
| Calculate the square root of x. More...
_const_ double | fabs (double x)
| Calculate the absolute value of x. More...
_const_ float | fabsf (float x)
| Calculate the absolute value of x. More...
_const_ double | round (double x)
| Calculate the integral value that is the nearest to x. More...
_const_ float | roundf (float x)
| Calculate the integral value that is the nearest to x. More...
_const_ double | sin (double x)
| Calculate the sine of an angle of x radians. More...
_const_ float | sinf (float x)
| Calculate the sine of an angle of x radians. More...
_const_ double | cos (double x)
| Calculate the cosine of an angle of x radians. More...
_const_ float | cosf (float x)
| Calculate the cosine of an angle of x radians. More...
_const_ double | exp (double x)
| base-e exponential function More...
_const_ float | expf (float x)
| base-e exponential function More...
_const_ int | ilogb (double x)
| Calculate integer exponent of a floating-point value. More...
_const_ int | ilogbf (float x)
| Calculate integer exponent of a floating-point value. More...
_const_ int | ilogbl (long double x)
| Calculate integer exponent of a floating-point value. More...
_const_ double | log (double x)
| Calculate the natural logarithm. More...
_const_ float | logf (float x)
| Calculate the natural logarithm. More...
_const_ double | logb (double x)
| Calculate exponent of a floating-point value. More...
_const_ float | logbf (float x)
| Calculate exponent of a floating-point value. More...
_const_ long double | logbl (long double x)
| Calculate exponent of a floating-point value. More...
_const_ double | fmax (double x, double y)
| Determine maximum of two floating-point numbers. More...
_const_ float | fmaxf (float x, float y)
| Determine maximum of two floating-point numbers. More...
_const_ long double | fmaxl (long double x, long double y)
| Determine maximum of two floating-point numbers. More...
_const_ double | fmin (double x, double y)
| Determine minimum of two floating-point numbers. More...
_const_ float | fminf (float x, float y)
| Determine minimum of two floating-point numbers. More...
_const_ double | scalbn (double x, int exp)
| Multiply floating-point number by integral power of radix. More...
_const_ double | scalbnl (long double x, int exp)
| Multiply floating-point number by integral power of radix. More...
_const_ float | scalbnf (float x, int exp)
| Multiply floating-point number by integral power of radix. More...
_const_ double | copysign (double x, double y)
| Copy sign of a number. More...
_const_ float | copysignf (float x, float y)
| Copy sign of a number. More...
_const_ double | floor (double x)
| Get largest integral value not greater than argument. More...
_const_ float | floorf (float x)
| Get largest integral value not greater than argument. More...
_const_ double | hypot (double x, double y)
| Euclidean distance function. More...
_const_ float | hypotf (float x, float y)
| Euclidean distance function. More...
double | modf (double x, double *iptr)
| extract signed integral and fractional values from floating-point number More...
float | modff (float x, float *iptr)
| extract signed integral and fractional values from floating-point number More...

## Detailed Description

## Macro Definition Documentation

#define FP_ILOGB0 FP_ILOGBNAN

`#include <math.h>`

ilogb return value if x is zero

#define FP_ILOGBNAN (-1-(int)(((unsigned)-1)>>1))

`#include <math.h>`

ilogb return value if x is NAN

#define INFINITY __builtin_inf()

`#include <math.h>`

Infinity number

#define isfinite | ( |  | x | ) | _isfinite(x)

`#include <math.h>`

Parameters

  [in] | x | - value to check for finite

Returns
  !0 - is number, 0 - NaN or infinite

#define isnan | ( |  | x | ) | _isnan(x)

`#include <math.h>`

Parameters

  [in] | x | - value to check for NaN

Returns
  0 - is number, !0 - NaN

#define M_E 2.7182818284590452354

`#include <math.h>`

e - base of the natural logarithm

#define M_PI 3.14159265358979323846

`#include <math.h>`

pi - the ratio of a circle's circumference to its diameter

#define M_PI_2 1.57079632679489661923

`#include <math.h>`

pi/2

#define M_PI_4 0.78539816339744830962

`#include <math.h>`

pi/4

#define NAN __builtin_nan("")

`#include <math.h>`

Not A Number

## Function Documentation

_const_ double atan | ( | double | x | ) |

`#include <math.h>`

Arc tangent function.

Parameters

  [in] | x | function argument

Returns
  arc tangent of function argument

_const_ double atan2 | ( | double | y,
|  | double | x
| ) |  |

`#include <math.h>`

Arc tangent function of two variables.

Parameters

  [in] | y | function argument
  [in] | x | function argument

Returns
  principal value of the arc tangent of y/x in radians

_const_ float atan2f | ( | float | y,
|  | float | x
| ) |  |

`#include <math.h>`

Arc tangent function of two variables.

Parameters

  [in] | y | function argument
  [in] | x | function argument

Returns
  principal value of the arc tangent of y/x in radians

_const_ float atanf | ( | float | x | ) |

`#include <math.h>`

Arc tangent function.

Parameters

  [in] | x | function argument

Returns
  arc tangent of function argument

_const_ double ceil | ( | double | x | ) |

`#include <math.h>`

ceiling function: smallest integral value not less than argument

Parameters

  [in] | x | function argument

Returns
  ceiling of x

_const_ float ceilf | ( | float | x | ) |

`#include <math.h>`

ceiling function: smallest integral value not less than argument

Parameters

  [in] | x | function argument

Returns
  ceiling of x

_const_ double copysign | ( | double | x,
|  | double | y
| ) |  |

`#include <math.h>`

Copy sign of a number.

Parameters

  [in] | x | function argument
  [in] | y | sign source

Returns
  value whose absolute value matches that of `x`, but whose sign bit matches that of `y`

_const_ float copysignf | ( | float | x,
|  | float | y
| ) |  |

`#include <math.h>`

Copy sign of a number.

Parameters

  [in] | x | function argument
  [in] | y | sign source

Returns
  value whose absolute value matches that of `x`, but whose sign bit matches that of `y`

_const_ double cos | ( | double | x | ) |

`#include <math.h>`

Calculate the cosine of an angle of x radians.

Parameters

  [in] | x | function argument in radians

Returns
  the result of calculation

_const_ float cosf | ( | float | x | ) |

`#include <math.h>`

Calculate the cosine of an angle of x radians.

Parameters

  [in] | x | function argument in radians

Returns
  the result of calculation

_const_ double exp | ( | double | x | ) |

`#include <math.h>`

base-e exponential function

Parameters

  [in] | x | function argument in radians

Returns
  value of e raised to the power of x

_const_ float expf | ( | float | x | ) |

`#include <math.h>`

base-e exponential function

Parameters

  [in] | x | function argument in radians

Returns
  value of e raised to the power of x

_const_ double fabs | ( | double | x | ) |

`#include <math.h>`

Calculate the absolute value of x.

Parameters

  [in] | x | function argument

Returns
  the result of calculation

_const_ float fabsf | ( | float | x | ) |

`#include <math.h>`

Calculate the absolute value of x.

Parameters

  [in] | x | function argument

Returns
  the result of calculation

_const_ double floor | ( | double | x | ) |

`#include <math.h>`

Get largest integral value not greater than argument.

Parameters

  [in] | x | function argument

Returns
  the floor of x

_const_ float floorf | ( | float | x | ) |

`#include <math.h>`

Get largest integral value not greater than argument.

Parameters

  [in] | x | function argument

Returns
  the floor of x

_const_ double fmax | ( | double | x,
|  | double | y
| ) |  |

`#include <math.h>`

Determine maximum of two floating-point numbers.

Parameters

  [in] | x | function argument
  [in] | y | function argument

Returns
  maximal value of `x` or `y`

_const_ float fmaxf | ( | float | x,
|  | float | y
| ) |  |

`#include <math.h>`

Determine maximum of two floating-point numbers.

Parameters

  [in] | x | function argument
  [in] | y | function argument

Returns
  maximal value of `x` or `y`

_const_ long double fmaxl | ( | long double | x,
|  | long double | y
| ) |  |

`#include <math.h>`

Determine maximum of two floating-point numbers.

Parameters

  [in] | x | function argument
  [in] | y | function argument

Returns
  maximal value of `x` or `y`

_const_ double fmin | ( | double | x,
|  | double | y
| ) |  |

`#include <math.h>`

Determine minimum of two floating-point numbers.

Parameters

  [in] | x | function argument
  [in] | y | function argument

Returns
  minimal value of `x` or `y`

_const_ float fminf | ( | float | x,
|  | float | y
| ) |  |

`#include <math.h>`

Determine minimum of two floating-point numbers.

Parameters

  [in] | x | function argument
  [in] | y | function argument

Returns
  minimal value of `x` or `y`

_const_ double hypot | ( | double | x,
|  | double | y
| ) |  |

`#include <math.h>`

Euclidean distance function.

Parameters

  [in] | x | function argument
  [in] | y | function argument

Returns
  length of a right-angled triangle with sides of length x and y

_const_ float hypotf | ( | float | x,
|  | float | y
| ) |  |

`#include <math.h>`

Euclidean distance function.

Parameters

  [in] | x | function argument
  [in] | y | function argument

Returns
  length of a right-angled triangle with sides of length x and y

_const_ int ilogb | ( | double | x | ) |

`#include <math.h>`

Calculate integer exponent of a floating-point value.

Parameters

  [in] | x | function argument

Returns
  exponent of x, as a signed integer

_const_ int ilogbf | ( | float | x | ) |

`#include <math.h>`

Calculate integer exponent of a floating-point value.

Parameters

  [in] | x | function argument

Returns
  exponent of x, as a signed integer

_const_ int ilogbl | ( | long double | x | ) |

`#include <math.h>`

Calculate integer exponent of a floating-point value.

Parameters

  [in] | x | function argument

Returns
  exponent of x, as a signed integer

_const_ double log | ( | double | x | ) |

`#include <math.h>`

Calculate the natural logarithm.

Parameters

  [in] | x | function argument

Returns
  the result of calculation

_const_ double logb | ( | double | x | ) |

`#include <math.h>`

Calculate exponent of a floating-point value.

Parameters

  [in] | x | function argument

Returns
  the result of calculation

_const_ float logbf | ( | float | x | ) |

`#include <math.h>`

Calculate exponent of a floating-point value.

Parameters

  [in] | x | function argument

Returns
  the result of calculation

_const_ long double logbl | ( | long double | x | ) |

`#include <math.h>`

Calculate exponent of a floating-point value.

Parameters

  [in] | x | function argument

Returns
  the result of calculation

_const_ float logf | ( | float | x | ) |

`#include <math.h>`

Calculate the natural logarithm.

Parameters

  [in] | x | function argument

Returns
  the result of calculation

double modf | ( | double | x,
|  | double * | iptr
| ) |  |

`#include <math.h>`

extract signed integral and fractional values from floating-point number

Parameters

  [in] | x | function argument
  [in,out] | iptr | integral part is stored in the location pointed to by iptr

Returns
  return the fractional part of x

float modff | ( | float | x,
|  | float * | iptr
| ) |  |

`#include <math.h>`

extract signed integral and fractional values from floating-point number

Parameters

  [in] | x | function argument
  [in,out] | iptr | integral part is stored in the location pointed to by iptr

Returns
  return the fractional part of x

_const_ double pow | ( | double | base,
|  | double | exp
| ) |  |

`#include <math.h>`

Calculate the exponentiation.

Parameters

  [in] | base | base value
  [in] | exp | exponent value

Returns
  base raised to the power exponent

_const_ float powf | ( | float | base,
|  | float | exp
| ) |  |

`#include <math.h>`

Calculate the exponentiation.

Parameters

  [in] | base | base value
  [in] | exp | exponent value

Returns
  base raised to the power exponent

_const_ double round | ( | double | x | ) |

`#include <math.h>`

Calculate the integral value that is the nearest to x.

Parameters

  [in] | x | function argument

Returns
  the result of calculation

_const_ float roundf | ( | float | x | ) |

`#include <math.h>`

Calculate the integral value that is the nearest to x.

Parameters

  [in] | x | function argument

Returns
  the result of calculation

_const_ double scalbn | ( | double | x,
|  | int | exp
| ) |  |

`#include <math.h>`

Multiply floating-point number by integral power of radix.

Parameters

  [in] | x | function argument
  [in] | exp | exponent

Returns
  result of calculation

_const_ float scalbnf | ( | float | x,
|  | int | exp
| ) |  |

`#include <math.h>`

Multiply floating-point number by integral power of radix.

Parameters

  [in] | x | function argument
  [in] | exp | exponent

Returns
  result of calculation

_const_ double scalbnl | ( | long double | x,
|  | int | exp
| ) |  |

`#include <math.h>`

Multiply floating-point number by integral power of radix.

Parameters

  [in] | x | function argument
  [in] | exp | exponent

Returns
  result of calculation

_const_ double sin | ( | double | x | ) |

`#include <math.h>`

Calculate the sine of an angle of x radians.

Parameters

  [in] | x | function argument in radians

Returns
  the result of calculation

_const_ float sinf | ( | float | x | ) |

`#include <math.h>`

Calculate the sine of an angle of x radians.

Parameters

  [in] | x | function argument in radians

Returns
  the result of calculation

_const_ double sqrt | ( | double | x | ) |

`#include <math.h>`

Calculate the square root of x.

Parameters

  [in] | x | function argument

Returns
  the result of calculation

_const_ float sqrtf | ( | float | x | ) |

`#include <math.h>`

Calculate the square root of x.

Parameters

  [in] | x | function argument

Returns
  the result of calculation