Java Math tanh() 方法

来源:这里教程网 时间:2026-02-16 11:51:10 作者:

前言

定义和用法tanh() 方法返回数的双曲正切值。双曲正切值等同于 Math.sinh(number) / Math.cosh(number)。实例返回不同数字的


定义和用法

tanh() 方法返回数的双曲正切值。

双曲正切值等同于 Math.sinh(number) / Math.cosh(number)


实例

返回不同数字的双曲正切值:

System.out.println(Math.tanh(3));
System.out.println(Math.tanh(-3));
System.out.println(Math.tanh(0));
System.out.println(Math.tanh(1));

运行实例 »

点击 "运行实例" 按钮查看在线实例


语法

public static double tanh(double number)

运行实例 »

点击 "运行实例" 按钮查看在线实例

参数

参数 描述
number 必需。需要求其双曲正切值的数字。

技术细节

返回: 表示数字的双曲正切值的 double 值。
Java 版本: 1.5+

相关推荐