Open In App

C# | Math.Cosh() Method

Last Updated : 26 Oct, 2021
Improve
Improve
Like Article
Like
Save
Share
Report

Math.Cosh() is the inbuilt Math class method which returns the hyperbolic cosine of a given double value argument. 
Syntax:
 

public static double Cosh(double num)

Parameters: 
 

num: It is the number whose hyperbolic cos is to be returned and type of this parameter is System.Double.

Return Value: The method returns the hyperbolic cos of num of type System.Double. If num is equal to NegativeInfinity or PositiveInfinity, PositiveInfinity is returned. If num is equal to NaN, NaN is returned.
Example:
 

Input   : 60.0
Output  : 5.71003694907842E+25

Below programs illustrate the Math.Cosh method:
Program 1: 
 

Csharp




// C# program to illustrate the
// Math.Cosh()
using System;
 
class GFG {
   
    // Main Method
    public static void Main(String[] args)
    {
 
        double num1 = 60.0, num2 = 0.0, num3 = 1.0;
 
        // It returns the hyperbolic cosine of
        // specified angle in radian
        double coshvalue = Math.Cosh(num1);
        Console.WriteLine("The cosh of num1 = " + coshvalue);
 
        coshvalue = Math.Cosh(num2);
        Console.WriteLine("The cosh of num2 = " + coshvalue);
 
        coshvalue = Math.Cosh(num3);
        Console.WriteLine("The cosh of num3 = " + coshvalue);
    }
}


Output: 

The cosh of num1 = 5.71003694907842E+25
The cosh of num2 = 1
The cosh of num3 = 1.54308063481524

 

Program 2: 
 

Csharp




// C# program to illustrate the
// Math.Cosh() Method
using System;
 
class GFG {
    
    // Main Method
    public static void Main(String[] args)
    {
 
        double num1 = (30 * (Math.PI)) / 180, num2 = 11.0, num3 = 45.0;
 
        // It returns the hyperbolic cosine of
        // angle in radian
        double coshvalue = Math.Cosh(num1);
        Console.WriteLine("The cosh of num1 = " + coshvalue);
 
        coshvalue = Math.Cosh(num2);
        Console.WriteLine("The cosh of num2 = " + coshvalue);
 
        coshvalue = Math.Cosh(num3);
        Console.WriteLine("The cosh of num3 = " + coshvalue);
    }
}


Output: 

The cosh of num1 = 1.14023832107643
The cosh of num2 = 29937.0708659498
The cosh of num3 = 1.74671355287425E+19

 



Previous Article
Next Article

Similar Reads

MathF.Cosh() Method in C# with Examples
Math.Cosh(Single) Method is the inbuilt MathF class method which returns the hyperbolic cosine of a given single value argument. Syntax: public static float Cosh (float x); Here, x is the number whose hyperbolic cosine is to be returned and type of this parameter is System.Single. Return Value: This method returns the hyperbolic cosine of x of type
2 min read
C# | Math.IEEERemainder() Method
In C#, IEEERemainder() is a Math class method which is used to return the remainder resulting from the division of a specified number by another specified number. Syntax: public static double IEEERemainder (double a, double b); Parameters: a: It is the dividend of type System.Double.b: It is the divisor of type System.Double. Return Type: This meth
2 min read
C# | Math.Sign() Method
In C#, Sign() is a math class method which returns an integer that specify the sign of the number. This method can be overloaded by changing the data type of the passed arguments as follows: Math.Sign(Decimal): Returns the integer that specifies the sign of a decimal number. Math.Sign(Double): Returns the integer that specifies the sign of a double
3 min read
C# | Math.BigMul() Method
In C#, BigMul() is a method class method. This method is used to compute the full product of two 32-bit numbers.Syntax: public static long BigMul(int a, int b) Parameters: a: It is the first number to be multiplied and the type of this parameter is System.Int32. b: It is the Second number to be multiplied and the type of this parameter is System.In
1 min read
C# | Math.Pow() Method
In C#, Math.Pow() is a Math class method. This method is used to calculate a number raise to the power of some other number. Syntax: public static double Pow(double base, double power) Parameters: double base: It is a double-precision floating-point number which is to be raised to a power and type of this parameter is System.Double. double power: I
2 min read
C# | Math.Floor() Method
In C#, Math.Floor() is a Math class method. This method is used to find the largest integer, which is less than or equal to the passed argument. The floor method operates both functionalities in decimal and double. This method can be overload by passing different arguments to it. Math.Floor(Decimal) Method Math.Floor(Double) Method Math.Floor(Decim
3 min read
C# | Math.Tanh() Method
Math.Tanh() is the inbuilt Math class method which returns the hyperbolic tan of a given double value argument. The result will be NaN if the given argument is NaN.Syntax: public static double Tanh(double num) Parameter: num: It is the number whose hyperbolic tan is to be returned and type of this parameter is System.Double. Return Value: The metho
2 min read
C# | Math.Ceiling() Method
In C#, Math.Ceiling() is a Math class method. This method is used to find the smallest integer , which is greater than or equal to the passed argument. The Ceiling method operates both functionalities in decimal and double. This method can be overload by passing different arguments to it. Math.Ceiling(Decimal) MethodMath.Ceiling(Double) Method Math
3 min read
C# | Math.Sinh() Method
Math.Sinh() is the inbuilt Math class method which returns the hyperbolic sine of a given double value argument(specified angle).Syntax: public static double Sinh(double num) Parameters: num: It is the number whose hyperbolic sine is to be returned and type of this parameter is System.Double. Return Value: The method returns the hyperbolic Sine of
2 min read
C# | Math.Sqrt() Method
In C#, Math.Sqrt() is a Math class method which is used to calculate the square root of the specified number. Sqrt is a slower computation. It can be cached for a performance boost. Syntax: public static double Sqrt(double d) Parameter: d: Number whose square root is to be calculated and type of this parameter is System.Double. Return Type: This me
3 min read
Article Tags :