C++ <cmath> (<math.h>) Header Functions

C++ <cmath> (<math.h>) header has the following built-in functions.

Functions Description
abs() Returns the absolute value of the given value.
acos() Returns the arc cosine value of the given value.
acosh() Returns the nonnegative area hyperbolic cosine of the given value.
isfinite() Checks whether the given value is finite value or not.
isgreater() Checks whether first value is greater than the second value.
isgreaterequal() Checks whether first value is greater than or equal to the second value.
isinf() Checks whether the given value is an infinite value.
isless() Checks whether first value is less than the second value.
islessequal() Checks whether first value is less than or equal to the second value.
islessgreater() Checks whether first value is either less than or greater than the second value.
isnan() Checks whether the given value is a NaN (Not-A-Number).
isnormal() Checks whether the given value is a normal value i.e. the value should not be infinity, NaN, Zero, or subnormal.
isunordered() Checks whether the given values are unordered (if one or both values are Not-A-Number (NaN)).
ldexp() Calculates the value from significand and exponent, it returns the multiplication of significand and 2 raised to the power of the exponent.
llrint() Rounds the given value and convert it to a long long integer.
llround() Rounds (with halfway cases) the given value and convert it to a long long integer.
log() Returns the natural logarithm (the base-e logarithm) of the given value.
log10() Returns the common logarithm (the base-10 logarithm) of the given value.
log1p() Returns the natural logarithm (the base-e logarithm) of the one plus given value.
log2() Returns the binary logarithm (the base-2 logarithm) of the given value.
logb() Returns the logarithm of |given value|, where logarithm base is FLT_RADIX (On the most of the platforms the FLT_RADIX is 2, thus, logb() function is similar to log2() function for the positive values.
lrint() Rounds the given value and convert it to a long integer.
lround() Round (with halfway cases) the given value and casts to a long integer.
modf() Breaks the fractional and integral parts of the given number.
nan() Returns a NaN (Not-A-Number) value of type double.
nanf() Returns a NaN (Not-A-Number) value of type float.
nanl() Returns a NaN (Not-A-Number) value of type long double.
nearbyint() Rounds the given value to an integral value.
nextafter() It is used to get the next representable value after the first parameter in the direction of the second parameter.
nexttoward() It is used to get the next representable value (toward precise value) after first parameter in the direction of the second parameter.
pow() It is used to calculate base (first parameter) raised to the power of exponent (second parameter).
remainder() It is used to calculate the remainder (IEC 60559).
remquo() It is used to calculate the remainder and quotient.
rint() It is used to round the given value to an integral values based on the specified direction by fegetround() function.
round() It is used to round the given value that is nearest to the number with halfway cases rounded away from zero.
scalbln() It scales the significand using floating-point base exponent (long int).
scalbn() It scales the significand using floating-point base exponent (int).
signbit() It is used to check the sign of the given value.


Comments and Discussions!

Load comments ↻





Copyright © 2024 www.includehelp.com. All rights reserved.