summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2008-03-10 16:18:50 (GMT)
committerdgp <dgp@users.sourceforge.net>2008-03-10 16:18:50 (GMT)
commit59ee2f1e347fb19a9228787a2fc637dbff1d875c (patch)
treed25c01ba6d2e399dc1205f75bdac979894afd528 /tests
parent549c3cdc807fe8a0a783fbb3d82d622afca1677e (diff)
downloadtcl-59ee2f1e347fb19a9228787a2fc637dbff1d875c.zip
tcl-59ee2f1e347fb19a9228787a2fc637dbff1d875c.tar.gz
tcl-59ee2f1e347fb19a9228787a2fc637dbff1d875c.tar.bz2
* generic/tclBasic.c (ExprAbsFunc): Revised so that the abs()
* tests/expr.test: function and the [::tcl::mathfunc::abs] command do not return the value of -0, or equivalent values with more alarming string reps like -1e-350. [Bug 1893815].
Diffstat (limited to 'tests')
-rw-r--r--tests/expr.test20
1 files changed, 19 insertions, 1 deletions
diff --git a/tests/expr.test b/tests/expr.test
index 0ee024c..d0aaadb 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.71 2007/12/13 15:26:06 dgp Exp $
+# RCS: @(#) $Id: expr.test,v 1.72 2008/03/10 16:18:55 dgp Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest 2.1
@@ -6342,6 +6342,24 @@ test expr-37.14 {expr edge cases} {wideIs64bit} {
test expr-38.1 {abs of smallest 32-bit integer [Bug 1241572]} {wideIs64bit} {
expr {abs(-2147483648)}
} 2147483648
+test expr-38.2 {abs and -0 [Bug 1893815]} {
+ expr {abs(-0)}
+} 0
+test expr-38.3 {abs and -0 [Bug 1893815]} {
+ expr {abs(-0.0)}
+} 0.0
+test expr-38.4 {abs and -0 [Bug 1893815]} {
+ expr {abs(-1e-324)}
+} 0.0
+test expr-38.5 {abs and -0 [Bug 1893815]} {
+ ::tcl::mathfunc::abs -0
+} 0
+test expr-38.6 {abs and -0 [Bug 1893815]} {
+ ::tcl::mathfunc::abs -0.0
+} 0.0
+test expr-38.7 {abs and -0 [Bug 1893815]} {
+ ::tcl::mathfunc::abs -1e-324
+} 0.0
testConstraint testexprlongobj [llength [info commands testexprlongobj]]
testConstraint testexprdoubleobj [llength [info commands testexprdoubleobj]]