beetlebug▾
/

tcl::mathfunc cosh

Gives the hyperbolic cosine of a number.

tcl::mathfunc::cosh NUMBER
expr {cosh(NUMBER)}

Description

Gives the hyperbolic cosine of NUMBER. A result too large for a double is Inf.

Arguments

ArgumentTypeDefaultDescription
NUMBERnumberrequiredAny number.

Returns

A float, 1 or more.

Examples

% expr {cosh(0)}
1.0

% expr {cosh(1)}
1.543080634815244

% expr {cosh(-1000)}
Inf

Errors

# Tcl 9.1 only
% expr {cosh("x")}
cannot use non-numeric string "x" as operand of "cosh"
-errorcode ARITH DOMAIN {non-numeric string}

# Tcl 8.6 only
% expr {cosh("x")}
can't use non-numeric string as operand of "cosh"
-errorcode ARITH DOMAIN {non-numeric string}

% expr {cosh()}
not enough arguments for math function "cosh"
-errorcode TCL WRONGARGS

Facts

Capability
None.
Tcl release
Tcl 9.1 and 8.6.
Since
ztcl 1.0.0-beta.1

See also