< Previous | Contents | Next >

Math Functions
























Computes the sine of (x * pi) (measured in radians)

float _sinpif(float x)

Computes the cosine of (x * pi) (measured in radians)

float _cospif(float x)

Computes the sine of x (measured in radians)

float _sinf(float x)

Computes the cosine of x (measured in radians)

float _cosf(float x)

Computes the square root of the sum of squares of x and y

float _hypotf(float x, float y)

Computes the floating-point remainder of x/y

float _fmod(float x, float y)

Returns the integral value nearest to x rounding, with half-way cases rounded away from zero

float _round(float x)

Returns the integral value nearest to but no larger in magnitude than x

float _truncf(float x)

Returns the largest integral value less than or equal to x

float _floorf(float x)

Returns the smallest integral value greater than or equal to x

float _ceilf(float x)

Computes the non-negative square root of x

float _sqrtf(float x)

Clamps x to be within the interval [0.0f, 1.0f]

float _saturatef(float x)

Clamps x to be within the interval [min, max]

float _clampf(float x, float min, float max)

Returns x or y, whichever is smaller

float _fminf(float x, float y)

Returns x or y, whichever is larger

float _fmaxf(float x, float y)

Returns x with its sign changed to y’s

float _copysignf(float x, float y)

Computes 10**x, the base-10 exponential of x

float _exp10f(float x)

















Returns a non-zero value if and only if x is a NaN value

int isnan(float x)

Returns a non-zero value if and only if x is an infinite value

int isinf(float x)

Returns 1/x

float _frecip(float x)

Returns x/y

float _fdivide(float x, float y)

Computes the reciprocal of square root of x

float _rsqrtf(float x)

Computes (x * y) + z as a single operation

float _fmaf(float x, float y, float z)

Returns the positive difference between x and y:x - y if x > y,

+0 if x is less than or equal to y

float _fdimf(float x, float y)

Computes the hyperbolic tangent of x

float _tanhf(float x)

Computes the hyperbolic sine of x

float _sinhf(float x)

Computes the hyperbolic cosine of x

float _coshf(float x)

Computes the inverse hyperbolic tangent of x

float _atanhf(float x)

Computes the principal value of the inverse hyperbolic sine of x

float _asinhf(float x)

Computes the principal value of the inverse hyperbolic cosine of x

float _acoshf(float x)

Computes the principal value of the arc tangent of y/x, using the signs of both arguments to determine the quadrant of the return value

float _atan2f(float y, float x)

Computes the principal value of the arc sine of x

float _asinf(float x)

Computes the principal value of the arc cosine of x

float _acosf(float x)

Computes the tangent of x (measured in radians)

float _tanf(float x)






image


NOTE that float values must have ‘f’ character at the end (e.g. 1.2f).

Returns x or y, whichever is smaller

int min(int x, int y)

Returns the absolute value of x

int abs(int x)

Returns (x * 2^exp)

float _ldexp(float x, int exp)

Extracts mantissa and exponent from x. The mantissa m returned is a float with magnitude in the interval [1/2, 1) or 0, and exp is updated with integer exponent value, whereas x = m * 2^exp

float _frexp(float x, int exp)

T is used to indicate that the function can take float, float2, float3, float4, as the type for the arguments.Returns: (x + (y - x)

* a). "a" must be a value in the range [0.0f, 1.0f]. If not, the return values are undefined.

T _mix(T x, T y, float a)

Returns a non-zero value if and only if sign bit of x is set

int signbit(float x)

List of integer math functions available





Returns x or y, whichever is larger

int max(int x, int y)