Cosh v0.1.0

Source
Returns the hyperbolic cosine.

Package: Math

Signature

func Cosh(x: float64) -> float64;
func Cosh(x: float32) -> float32;

Parameters

NameTypeDescription
xfloat64 / float32Any value.

Returns

The hyperbolic cosine of x, always at least 1.0. Cosh(±Inf) is +Inf. Cosh overflows to +Inf for large |x|. A NaN argument propagates.

Example

import Math::Cosh;

func Main() -> int {
    let a = Cosh(0.0); // 1.0
    let b = Cosh(1.0); // 1.5430806348152437
    return 0;
}

See also

  • Math — the package overview
  • Sinh — hyperbolic sine
  • Tanh — hyperbolic tangent
  • Exp — the exponential Cosh is built on