beetlebug▾
/

tcl::mathfunc expm1Tcl 9.1 only

Gives e to the power of a number, minus 1.

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

Description

Gives exp(NUMBER) - 1. For a NUMBER near zero it keeps the digits that the subtraction loses.

Arguments

ArgumentTypeDefaultDescription
NUMBERnumberrequiredThe exponent.

Returns

A float greater than -1.

Examples

% expr {expm1(1e-10)}
1.00000000005e-10

% expr {expm1(1)}
1.718281828459045

% expr {expm1(0)}
0.0

Errors

% expr {expm1("x")}
expected floating-point number but got "x"
-errorcode TCL VALUE NUMBER

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

Facts

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

See also