DoxigAlpha

cosh

Returns the hyperbolic cosine of x.

Special Cases:

  • cosh(+-0) = 1
  • cosh(+-inf) = +inf
  • cosh(nan) = nan

Function parameters

Parameters

#
x:anytype

Returns the hyperbolic cosine of x.

Functions

#
cosh
Returns the hyperbolic cosine of x.

Source

Implementation

#
pub fn cosh(x: anytype) @TypeOf(x) {
    const T = @TypeOf(x);
    return switch (T) {
        f32 => cosh32(x),
        f64 => cosh64(x),
        else => @compileError("cosh not implemented for " ++ @typeName(T)),
    };
}