Library Function hypot in Math Class
Library Function hypot of math.h Header File in C
In this section, we will discuss about library function hypot in math class which is used in C.
The C header file math.h contains the standard math library functions that can be used for performing various mathematical operations. The hypot function is used to find hypotenuse when other two sides are provided.
Library Function hypot of math.h Header File
- In C programming language the hypot function is included in math.h header file.Hypotenuse is the longest side of the right angled triangle.
- The range of input arguments which are passed to hypot function can be of double or float or lonf double type.
Declaration of hypot function
double hypot(double p, double b);
Parameters of hypot function
The hypot function accepts two input arguments which are of double type.
|p – perpendicular||This value of double function ranges to all positive and negative numbers.|
|b – base||This value of double function ranges to all positive and negative numbers.|
Return value of hypot function
The hypot function returns a cube root value and it’s type is double.
|h – hypotenuse||It returns the value in double.|
Implementation of Library Function math.h hypot()
The following code shows the use of hypot function.
hypot(5.00, 12.00) = 13.00
The Hypotenuse Value of 10 & 0 = 10.0000 The Hypotenuse Value of 5 & 20 = 20.6155
Get over 200+ course One Subscription
Courses like AI/ML, Cloud Computing, Ethical Hacking, C, C++, Java, Python, DSA (All Languages), Competitive Coding (All Languages), TCS, Infosys, Wipro, Amazon, DBMS, SQL and others