summaryrefslogtreecommitdiffstats
path: root/tests/expr-old.test
diff options
context:
space:
mode:
authorMiguel Sofer <miguel.sofer@gmail.com>2004-07-03 22:13:10 (GMT)
committerMiguel Sofer <miguel.sofer@gmail.com>2004-07-03 22:13:10 (GMT)
commit36f0b17eedac2ea94cfbfdb058c125e8b739720d (patch)
tree012b8d3759af2211716f2251be0f17935bb0f08b /tests/expr-old.test
parente00c5053c35d5d3555dd1a307687cf71f158a499 (diff)
downloadtcl-36f0b17eedac2ea94cfbfdb058c125e8b739720d.zip
tcl-36f0b17eedac2ea94cfbfdb058c125e8b739720d.tar.gz
tcl-36f0b17eedac2ea94cfbfdb058c125e8b739720d.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.test17
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} {