diff options
author | Miguel Sofer <miguel.sofer@gmail.com> | 2004-07-03 22:13:10 (GMT) |
---|---|---|
committer | Miguel Sofer <miguel.sofer@gmail.com> | 2004-07-03 22:13:10 (GMT) |
commit | 942f234d4870b465504b7a6ec70339f64a9ae69e (patch) | |
tree | 012b8d3759af2211716f2251be0f17935bb0f08b /tests/expr-old.test | |
parent | 3b08ffe2fac031e39b7c213a45eb00e811a66b04 (diff) | |
download | tcl-942f234d4870b465504b7a6ec70339f64a9ae69e.zip tcl-942f234d4870b465504b7a6ec70339f64a9ae69e.tar.gz tcl-942f234d4870b465504b7a6ec70339f64a9ae69e.tar.bz2 |
added support for wide integers to round(); [Bug 908375], reported by
Hemang Lavana.
Diffstat (limited to 'tests/expr-old.test')
-rw-r--r-- | tests/expr-old.test | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/tests/expr-old.test b/tests/expr-old.test index 17d32d2..90f5cd0 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.16.2.1 2003/03/27 13:49:22 dkf Exp $ +# RCS: @(#) $Id: expr-old.test,v 1.16.2.2 2004/07/03 22:13:11 msofer Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest 2.1 @@ -982,6 +982,21 @@ test expr-old-38.1 {Verify Tcl_ExprString's basic operation} { } {5 10.2 1 {syntax error in expression "1+": premature end of expression}} } +# +# Test for bug #908375: rounding numbers that do not fit in a +# long but do fit in a wide +# + +test expr-old-39.1 {Rounding with wide result} { + set x 1.0e10 + set y [expr $x + 0.1] + catch { + set x [list [expr {$x == round($y)}] [expr $x == -round(-$y)]] + } + set x +} {1 1} +unset x y + # Special test for Pentium arithmetic bug of 1994: if {(4195835.0 - (4195835.0/3145727.0)*3145727.0) == 256.0} { |