diff options
author | nijtmans <nijtmans> | 2010-02-21 20:27:49 (GMT) |
---|---|---|
committer | nijtmans <nijtmans> | 2010-02-21 20:27:49 (GMT) |
commit | eed7d81a6e748db77c5751d36ac023a6b95fec8b (patch) | |
tree | eedb446108bd07060d6917c24a6c22350f9708e4 /tests | |
parent | 76bfa8368792738afb69378d51241d1b8d7385ad (diff) | |
download | tcl-eed7d81a6e748db77c5751d36ac023a6b95fec8b.zip tcl-eed7d81a6e748db77c5751d36ac023a6b95fec8b.tar.gz tcl-eed7d81a6e748db77c5751d36ac023a6b95fec8b.tar.bz2 |
Fix [Bug 2954959] expr abs(0.0) is -0.0
and added test cases for it.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/expr.test | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/tests/expr.test b/tests/expr.test index f1054ef..bd6d2b4 100644 --- a/tests/expr.test +++ b/tests/expr.test @@ -10,7 +10,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.test,v 1.72.2.3 2009/06/01 21:32:53 dgp Exp $ +# RCS: @(#) $Id: expr.test,v 1.72.2.4 2010/02/21 20:27:50 nijtmans Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest 2.1 @@ -6688,6 +6688,24 @@ test expr-38.6 {abs and -0 [Bug 1893815]} { test expr-38.7 {abs and -0 [Bug 1893815]} { ::tcl::mathfunc::abs -1e-324 } 0.0 +test expr-38.8 {abs and 0.0 [Bug 2954959]} { + ::tcl::mathfunc::abs 0.0 +} 0.0 +test expr-38.9 {abs and 0.0 [Bug 2954959]} { + expr {abs(0.0)} +} 0.0 +test expr-38.10 {abs and -0x0 [Bug 2954959]} { + expr {abs(-0x0)} +} 0 +test expr-38.11 {abs and 0x0 [Bug 2954959]} { + ::tcl::mathfunc::abs { 0x0} +} { 0x0} +test expr-38.12 {abs and -0x0 [Bug 2954959]} { + ::tcl::mathfunc::abs { -0x0} +} 0 +test expr-38.13 {abs and 0.0 [Bug 2954959]} { + ::tcl::mathfunc::abs 1e-324 +} 1e-324 testConstraint testexprlongobj [llength [info commands testexprlongobj]] testConstraint testexprdoubleobj [llength [info commands testexprdoubleobj]] |