C++ Math less()30 Aug 2024 | 2 min read The less() function determines whether the value of first argument is less than the value of second argument. If first argument is less than the second argument then it returns 1 otherwise 0. Note: If one or both the arguments are NAN, then the function returns false(0).SyntaxConsider two numbers 'x' and 'y'. Syntax would be: Parameter(x,y): The values which we want to compare. Return value
Example 1Let's see a simple example when both x and y are of same type. Output: Values of x and y are : 1.2,1.3 isless(x,y) : 1 In this example, isless() function determines that the value of x is less than y. Therefore, it returns 1. Example 2Let's see a simple example when both x and y are of different type. Output: Values of x and y are : 7.2,5 isless(x,y) :0 In this example, isless() function determines that the value of x is not less than y. Therefore, it returns 0. Example 3Let's see a simple example when the value of x is nan. Output: Values of x and y are : nan,5.67 isless(x,y) : 0 In this example, value of x is nan. Therefore, the function returns 0. Next TopicC++ Math Functions |
math lgamma() function
C++ Math lgamma() The lgamma() function computes the logarithm of a gamma function of an argument passed to the function. Suppose a number is x: Syntax float lgamma(float x); double lgamma(double x); long double lgamma(long double x); double lgamma(integral x); Parameter x: It is a floating point value. Return value It returns the logarithm of a gamma...
2 min read
math frexp() function
C++ Math frexp() This function breaks the floating point number into the binary significand and an integral exponent. Let the floating point number be x then, x = (significand)*2e where, 'e' is the exponent and 'significand' is the binary significand Syntax Suppose a floating point number be 'x' and pointer be...
3 min read
math floor() function
C++ Math floor() It rounds the value to the nearest integer which is not greater than the given value. For example: floor(8.2)=8.0; floor(-8.8)=-9.0; Syntax Suppose a number is 'x'. Syntax would be : double floor(double x); Parameter x : It is the value that rounds to the nearest integer. Return value It returns the value that round...
1 min read
math isfinite() function
C++ Math isfinite() The function determines the value whether it is finite or not. It should not be NaN or infinite value. If the number is finite, it returns 1 otherwise 0. Note: A finite value is a value that is neither NAN nor infinite. Syntax Suppose a number is...
2 min read
math hypot() function
C++ Vector hypot() This function finds the square root of the sum of the squares of two numbers. It stands for hypotenuse, is used to find the hypotenuse of a right angled triangle. Consider three numbers x,y and z : hypotenuse of a right angle triangle = √x2+y2 distance from...
1 min read
math isnan() function
C++ Math isnan() The function checks whether the number is a Not a Number or not. If the number is NaN, it returns 1 otherwise 0. Note: The NaN is a non-representable value for floating point elements such as square root of negative number or the result of...
1 min read
math acosh() function
C++ Math acosh() The function computes the arc hyperbolic cosine of an angle given in radian. Where, an arc hyperbolic cosine is the inverse operation of hyperbolic cosine. cosh-1x = acosh(x); Syntax Suppose an angle is 'x': float acosh(float x); double acosh(double x); long double acosh(long double x); double acosh(integral x); Parameter x: The value whose arc...
1 min read
math expm1() function
C++ Math expm1() The function computes the exponential 'e' raised to the power a given number minus 1. Suppose a number is 'x' expm1(x) = e<sup>x</sup> - 1; Syntax float expm1(float x); double expm1(double x); long double expm1(long double x); double expm1(integral x); Note: The return_type can be float, double or long double. Parameter x: It...
1 min read
math atan() function
C++ Math atan() The function computes the inverse tangent of a number given in radian. atan(x) = tan-1x Syntax Suppose a number is 'x'. Syntax would be: float atan(float x); double atan(double x); long double atan(long double x); double atan(integral x); Note: If the value passed is an integer type, then it is cast to...
2 min read
math sqrt() function
sqrt() in C++ In C++, the sqrt() function is used to calculate the square root of a non-negative value. It belongs to the library and produces a double-type result. This function is accessed through the header. It is specified in the header file. It calculates the positive...
4 min read
We request you to subscribe our newsletter for upcoming updates.

We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India