Mathematical functions
Mathematical functions (such as sine and cosine) are replaced with a call to the Tcl mathfunc
namespace. This does not require any additional syntax to access the namespace as it is called automatically. These are invoked by passing the Function followed by the value or values to evaluate to the expr command. Those functions that accept multiple arguments require that the arguments be comma delimited. The default Mathematical functions are listed below in alphabetical order. These functions require a specific syntax (for example expr {function(value,value)})
to be accessed, as described in the Computing mathematical expressions section that follows:
Function |
Result |
---|---|
|
Returns the absolute value of Numeric operators may be integer or floating-point. Value is returned in the same format. |
|
Returns the arc cosine of |
|
Returns the arc sine of |
|
Returns the Arc Tangent of x/y. |
|
Returns the Boolean value of |
|
Returns the smallest floating-point integer value not less than Any numeric value is acceptable. |
|
Returns the cosine of If the result produces an over-flow, an error is returned. |
|
Converts May return INF or INF when the numeric value is such that it exceeds the floating-point value. |
|
Converts |
|
Returns the exponential of If the result produces an over-flow, an error is returned. |
|
Returns the largest floating-point integer not greater than The argument may be any numeric value. |
|
Returns the remainder of If |
|
Returns the length of the hypotenuse of a right angled triangle. |
|
Returns the low order bits of |
|
Returns the integer portion of the square root of Arg must be a positive value (integer or floating-point). |
|
Returns the natural logarithm of
|
|
Returns the base 10 logarithm of
|
|
This function accepts one or more numeric values and returns the greatest. |
|
This function accepts one or more numeric and returns the least one. |
|
Returns the value of If |
|
Returns a pseudo-random floating-point integer in the range of 0, 1. |
|
Returns the rounded value of If |
|
Returns the sine of |
|
Returns the hyperbolic sin of If the result produces an over-flow, an error is returned. |
|
Returns the square root of Accepts any non-negative numeric value. May return INF when the value is a numeric value that exceeds the square of the maximum value for the floating-point range. |
|
Resets the seed for the random number generator and returns a random number as described in |
|
Returns the tangent of |
|
Returns the hyperbolic tangent of |
|
Returns the low order 64 bits of Accepts any numeric value. |