Home » JavaScript Tutorial

Math.cosh() Method with Example in JavaScript

JavaScript | Math.cosh() Method: Here, we are going to learn about the cosh() method of Math class in JavaScript with Examples.
Submitted by Shivang Yadav, on December 06, 2019

JavaScript | Math.cosh() Method

Math operations in JavaScript are handled using functions of math library in JavaScript. In this tutorial on Math.cosh() method, we will learn about the cosh() method and its working with examples.

Math.cosh() is a function in math library of JavaScript that is used to find the value of hyperbolic cosine of a number.

Syntax:

    Math.cosh(p);

Parameter(s):

  • p – It represents the value whose hyperbolic cosine value to be found.

Return value:

The return type of this method is number, it returns the hyperbolic cosine value of the given p.

Example 1: Find the cosh of numeric values

console.log(Math.cosh(1));
console.log(Math.cosh(22));
console.log(Math.cosh(-2));
console.log(Math.cosh(4.23));

Output

1.5430806348152437
1792456423.065796
3.7621956910836314
34.36589228219746

Example 2: Find the cosh of non-numeric values

console.log(Math.cosh(1 + 2i));
console.log(Math.cosh("Hello"));
console.log(Math.cosh('x'));

Output

Invalid or unexpected token
NaN
NaN






Comments and Discussions

Ad: Are you a blogger? Join our Blogging forum.




Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing
» Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates


© https://www.includehelp.com some rights reserved.