http://www.tcl.tk/man/tcl8.5/TclCmd/mathfunc.htm describes these functions.
--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings
Here's some output from an 8.5 tclsh:
$ tclsh8.5
% expr rand()
0.5210889827092593
% expr srand()
too few arguments for math function "srand"
% expr srand(3.2)
expected integer but got "3.2"
% expr srand("whee")
expected integer but got "whee"
% expr rand(1,2,3)
too many arguments for math function "rand"
% expr srand(1,2)
too many arguments for math function "srand"
% expr srand(1)
7.826369259425611e-6
to convert an arbitrary argument to an integer, use the 'toInteger' helper
sub. It
should throw the appropriate error if given an invalid value. tests for
expr are in
t/cmd_expr.t (and are written in Tcl)
(Right now the too few/too many errors are handled via the pge/ast/pir
transform, so
you don't need to handle that in the .sub definition itself.)