Function cosh [src]
Alias for std.math.cosh.cosh
Returns the hyperbolic cosine of x.
Special Cases:
cosh(+-0) = 1
cosh(+-inf) = +inf
cosh(nan) = nan
Prototype
pub fn cosh(x: anytype) @TypeOf(x)
Example
test cosh {
try expect(cosh(@as(f32, 1.5)) == cosh32(1.5));
try expect(cosh(@as(f64, 1.5)) == cosh64(1.5));
}
Source
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)),
};
}