diff options
author | Miguel Sofer <miguel.sofer@gmail.com> | 2004-07-03 21:36:32 (GMT) |
---|---|---|
committer | Miguel Sofer <miguel.sofer@gmail.com> | 2004-07-03 21:36:32 (GMT) |
commit | 6b52572402aa98c5475a5ef13429851b3306c0e3 (patch) | |
tree | 3d3362593e7cfb8ef04ca4c037c2354cdaf3861a /tests | |
parent | a948104085f71c7726e9e831170e90b071cf2356 (diff) | |
download | tcl-6b52572402aa98c5475a5ef13429851b3306c0e3.zip tcl-6b52572402aa98c5475a5ef13429851b3306c0e3.tar.gz tcl-6b52572402aa98c5475a5ef13429851b3306c0e3.tar.bz2 |
added support for wide integers to round(); [Bug 908375], reported by
Hemang Lavana.
Diffstat (limited to 'tests')
-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 85a408b..4025839 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.19 2004/06/23 15:36:56 dkf Exp $ +# RCS: @(#) $Id: expr-old.test,v 1.20 2004/07/03 21:36:33 msofer Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest 2.1 @@ -969,6 +969,21 @@ test expr-old-38.1 {Verify Tcl_ExprString's basic operation} testexprstring { [catch {testexprstring "1+"} msg] $msg } {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} { |