Ruby | Math cosh() function Last Updated : 21 Jun, 2022 Summarize Comments Improve Suggest changes Share Like Article Like Report The cosh() is an inbuilt function in Ruby returns the hyperbolic cosine of value given in radians. The value passed is in range [-inf, +inf]. The returned value is in range [1, +inf]. Syntax: Math.cosh(value) Parameters: The function accepts one mandatory parameter value whose corresponding hyperbolic cosine value is returned. Return Value: It returns the hyperbolic cosine value. Example 1: CPP # Ruby program for cosh() function # Assigning values val1 = 0 val2 = 0.67 val3 = 1 val4 = 2 # Prints the cosh() value puts Math.cosh(val1) puts Math.cosh(val2) puts Math.cosh(val3) puts Math.cosh(val4) Output: 1.0 1.232972949211241 1.5430806348152437 3.7621956910836314 Example 2: CPP # Ruby program for cosh() function # Assigning values val1 = 131 val2 = -0.9 val3 = -98 val4 = -767 # Prints the cosh() value puts Math.cosh(val1) puts Math.cosh(val2) puts Math.cosh(val3) puts Math.cosh(val4) Output: 3.9043355367595756e+56 1.4330863854487745 1.8189854738044024e+42 Infinity Reference: https://devdocs.io/ruby~2.5/math#method-c-cosh Comment More infoAdvertise with us Next Article Ruby | Math cosh() function G gopaldave Follow Improve Article Tags : Ruby Ruby-Methods Ruby Math-class Similar Reads Ruby | Math acosh() function The acosh() is an inbuilt function in Ruby returns the inverse hyperbolic cosine of an angle given in radians. Syntax: Math.acosh(value) Parameters: The function accepts one mandatory parameter value which specifies the inverse hyperbolic angle in radian which should be greater or equal to 1. If the 1 min read Ruby | Math cos() function The cos() is an inbuilt function in Ruby returns the cosine value of a given angle expressed in radians which is in range [-inf, +inf]. The returned value is in range [-1, +1]. Syntax: Math.cos(value) Parameters: The function accepts one mandatory parameter value whose corresponding cosine value is 1 min read Ruby | Math acos() function The acos() is an inbuilt function in Ruby which returns the inverse cosine of a number (argument) in radians. The value which is returned by the acos() function always lies between âpi to +pi. Syntax: Math.acos(value) Parameters: This function accepts one mandatory parameter value which specifies th 1 min read Ruby | Math asinh() function The asinh() is an inbuilt function in Ruby returns the inverse hyperbolic sine of an angle given in radians. It accepts all values between range (-INFINITY, INFINITY). Syntax: Math.asinh(value) Parameters: The function accepts one mandatory parameter value which specifies the inverse hyperbolic ang 1 min read Ruby | Math cbrt() function The cbrt() is an inbuilt function in Ruby returns the cube root of a given value. Syntax: Math.cbrt(value) Parameters: The function accepts one mandatory parameter value whose cuberoot is to be returned. Return Value: It returns the cuberoot of the value. Example 1: Ruby #Ruby program for cbrt() 1 min read Like