diff options
author | dgp <dgp@noemail.net> | 2000-12-14 22:24:45 (GMT) |
---|---|---|
committer | dgp <dgp@noemail.net> | 2000-12-14 22:24:45 (GMT) |
commit | db3ebf8885014976c4e8f2358352abc23093986d (patch) | |
tree | be94609b8cdd9a6fa99217e63f11a8b23e5185a0 /tests/expr-old.test | |
parent | a85e89ecbfcb74c55a83966f3d0fd3e1aa3436a3 (diff) | |
download | tcl-db3ebf8885014976c4e8f2358352abc23093986d.zip tcl-db3ebf8885014976c4e8f2358352abc23093986d.tar.gz tcl-db3ebf8885014976c4e8f2358352abc23093986d.tar.bz2 |
2000-12-14 Don Porter <dgp@users.sourceforge.net>
* generic/tclExecute.c:
* tests/expr-old.test: Re-wrote Tcl's [expr rand()] and
[expr srand($seed)] implementations, fixing a range error
on some 64-bit platforms. Added tests that detect the bug.
The rewrite changes the seed -> sequence map on 64-bit
platforms, only for seed >= 2^31, a slight incompatibility.
[Bug 121072, Patch 102781]
FossilOrigin-Name: ce0aad6ef50300ab580c5c8dfcd075a34052b49a
Diffstat (limited to 'tests/expr-old.test')
-rw-r--r-- | tests/expr-old.test | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/expr-old.test b/tests/expr-old.test index b810d6f..81c5536 100644 --- a/tests/expr-old.test +++ b/tests/expr-old.test @@ -13,7 +13,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: expr-old.test,v 1.9 2000/05/09 00:00:36 hobbs Exp $ +# RCS: @(#) $Id: expr-old.test,v 1.10 2000/12/14 22:24:48 dgp Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest @@ -825,6 +825,12 @@ test expr-old-32.50 {math functions in expressions} { test expr-old-32.51 {math functions in expressions} { list [catch {expr {srand([lindex "6ty" 0])}} msg] $msg } {1 {argument to math function didn't have numeric value}} +test expr-old-32.52 {math functions in expressions} { + expr {srand(1<<37) < 1} +} {1} +test expr-old-32.53 {math functions in expressions} { + expr {srand((1<<31) - 1) > 0} +} {1} test expr-old-33.1 {conversions and fancy args to math functions} { expr hypot ( 3 , 4 ) |