strictmath

StrictMath类cosh()方法 (StrictMath Class cosh() method)

  • cosh() method is available in java.lang package.

    cosh()方法在java.lang包中可用。

  • cosh() method is used to return the hyperbolic cosine of an angle of the given parameter in the method. Here, "cosh" stands for hyperbolic cosine of an angle.

    cosh()方法用于返回方法中给定参数角度的双曲余弦值。 在此,“ cosh”代表某个角度的双曲余弦。

  • cosh() method is a static method so it is accessible with the class name and if we try to access the method with the class object then we will not get an error.

    cosh()方法是静态方法,因此可以使用类名进行访问,如果尝试使用类对象访问该方法,则不会收到错误。

  • In this method, we pass only radians type argument (i.e. First we convert given argument in radians by using toRadians() method of StrictMath class then after we will pass the same variable in cosh() method).

    在此方法中,我们仅传递弧度类型的参数(即,首先,我们使用StrictMath类的toRadians()方法将给定的参数转换为弧度,然后在cosh()方法中传递相同的变量)。

  • cosh() method does not throw any exception.

    cosh()方法不会引发任何异常。

Syntax:

句法:

    public static double cosh(double d);

Parameter(s):

参数:

  • double d – represents the value whose hyperbolic cosine of an angle is to be returned.

    double d –表示要返回其角度的双曲余弦的值。

Return value:

返回值:

The return type of this method is double – it returns the hyperbolic cosine value of the given argument.

这种方法的返回类型是双 -它返回给定参数的双曲余弦值。

Note:

注意:

  • If we pass NaN, the method returns NaN.

    如果传递NaN,则该方法返回NaN。

  • If we pass an infinity (positive or negative), the method returns the same value.

    如果我们传递无穷大(正数或负数),则该方法将返回相同的值。

  • If we pass a zero (positive or negative), the method returns the 1.0.

    如果传递零(正数或负数),则该方法返回1.0。

Example:

例:

// Java program to demonstrate the example
// of  cosh(double d) method of StrictMath Class.
public class Cosh {public static void main(String[] args) {// variable declarations
double d1 = 7.0 / 0.0;
double d2 = -7.0 / 0.0;
double d3 = 0.0;
double d4 = -0.0;
double d5 = 60.0;
// Display previous value of d1,d2,d3,d4 and d5
System.out.println("d1: " + d1);
System.out.println("d2: " + d2);
System.out.println("d3: " + d3);
System.out.println("d4: " + d4);
System.out.println("d5: " + d5);
// By using toRadians() method to convert
// absolute value into radians.
d1 = StrictMath.toRadians(d1);
d2 = StrictMath.toRadians(d2);
d3 = StrictMath.toRadians(d3);
d4 = StrictMath.toRadians(d4);
d5 = StrictMath.toRadians(d5);
// Here , we will get (infinity) because we are
// passing parameter whose value is (infinity)
System.out.println("StrictMath.cosh(d1): " + StrictMath.cosh(d1));
// Here , we will get (infinity) because we are
// passing parameter whose value is (-infinity)
System.out.println("StrictMath.cosh(d2): " + StrictMath.cosh(d2));
// Here , we will get (1.0) because we are
// passing parameter whose value is (0.0)
System.out.println("StrictMath.cosh(d3): " + StrictMath.cosh(d3));
// Here , we will get (1.0) because we are
// passing parameter whose value is (-0.0)
System.out.println("StrictMath.cosh(d4): " + StrictMath.cosh(d4));
// Here we will find hyperbolic cosine of d5 by
// using cosh() method
System.out.println("StrictMath.cosh(d5): " + StrictMath.cosh(d5));
}
}

Output

输出量

d1: Infinity
d2: -Infinity
d3: 0.0
d4: -0.0
d5: 60.0
StrictMath.cosh(d1): Infinity
StrictMath.cosh(d2): Infinity
StrictMath.cosh(d3): 1.0
StrictMath.cosh(d4): 1.0
StrictMath.cosh(d5): 1.600286857702386

翻译自: https://www.includehelp.com/java/strictmath-cosh-method-with-example.aspx

strictmath

strictmath_Java StrictMath cosh()方法与示例相关推荐

  1. java hypot_Java StrictMath hypot()方法与示例

    StrictMath类hypot()方法hypot()方法在java.lang包中可用. hypot()方法用于返回sqrt(sq(d1)+ sq(d2))的平方根,而不进行任何中间运算,换句话说,它 ...

  2. java abs在哪个包,Java StrictMath abs()方法

    Java StrictMath abs()方法 java.lang.StrictMath.abs(float a) 方法返回一个浮点值的绝对值.如果参数不是负数,则返回该参数.如果参数为负数,则返回该 ...

  3. java hypot_Java StrictMath hypot()方法

    Java StrictMath hypot()方法 java.lang.StrictMath.hypot() 方法返回 sqrt(x2 + y2) 没有中间溢或下溢.它包括了一些情况: 如果任一参数为 ...

  4. java cos90,Java Math.cosh() 方法

    Java Math.cosh() 方法 java.lang.Math.cosh() 用于返回值的双曲余弦值.任何值x的双曲余弦可以定义为(ex + e-x)/2,其中e是欧拉数. 1 语法 publi ...

  5. Python math.cosh() 方法

    Python math模块中定义了一些数学函数.由于这个模块属于编译系统自带,因此它可以被无条件调用.该模块还提供了与用标准C定义的数学函数的接口.本文主要介绍Python math.cosh() 方 ...

  6. .net连接mysql数据_.net连接MYSQL数据库的方法及示例!

    连接MYSQL数据库的方法及示例 方法一: 使用MYSQL推出的MySQL Connector/Net is an ADO.NET driver for MySQL 该组件为MYSQL为ADO.NET ...

  7. set.difference() 的用法(python3)_Python 集合 difference_update() 使用方法及示例

    Python 集合 difference_update() 使用方法及示例 Difference_update()使用集合的差集更新集合,并调用difference_update()方法. 如果A和B ...

  8. doc python 颜色_Python wordcloud.ImageColorGenerator方法代码示例

    本文整理汇总了Python中wordcloud.ImageColorGenerator方法的典型用法代码示例.如果您正苦于以下问题:Python wordcloud.ImageColorGenerat ...

  9. isdigit函数在C语言什么意思,C 库函数 isdigit() 使用方法及示例

    C 库函数 isdigit() 使用方法及示例 isdigit()函数检查字符是否为数字字符(0-9). isdigit()的函数原型int isdigit( int arg ); 函数isdigit ...

最新文章

  1. win7拒绝访问_win7系统提示无法访问application data如何解决
  2. Python每日一练0004
  3. Open Train 10394
  4. java 日历选择天_Java程序使用Java日历将天添加到当前日期
  5. Git笔记(29) 搜索
  6. Bailian4041 矩阵运算【数学计算】
  7. php日历天气预报下载安装手机桌面_手机桌面时钟日历天气
  8. 黑客的入侵方式你知道几种?
  9. 华为云私有云解决方案的年终答卷
  10. 图片转Excel表格在线工具,分享几款不错的工具!
  11. matlab受力分析,基于Matlab的多支座蒸压釜的受力分析和强度计算
  12. “AI复活了我的妻子,但我决定跟她说再见了”
  13. getPrepayId php,php微信支付接口开发程序
  14. 西南大学2019春计算机作业答案,2019年西南大学作业答案[1175]《仪器分析》
  15. 方法重写的两同两小一大原则
  16. 从会种田到“慧种田”,传感技术成“刚需”!
  17. Google Scholar引用没有GB/T
  18. 六、数据(分组)计算
  19. 计算机术语表达因果,因果推断简介之五:因果图 (Causal Diagram)
  20. 怎么看越努力,越幸运?

热门文章

  1. 最优分配问题——拍卖算法
  2. 深度学习/计算机视觉学习资料
  3. 微信环境中如何设置微信跳转浏览器打开链接
  4. Verilog描述有限状态机(一段式、二段式、三段式)
  5. 《疯狂Java讲义》读书笔记2
  6. 企业spark案例 —— 出租车轨迹分析(2)
  7. Arrays.sort() 实现降序排列 Comparator接口实现的坑
  8. 谷歌Chrome浏览器中如何打开或关闭网页的自动翻译功能
  9. colab 从云端批量下载文件到本地
  10. 脑裂产生以及解决办法