diff options
author | Kevin B Kenny <kennykb@acm.org> | 2005-04-26 16:32:52 (GMT) |
---|---|---|
committer | Kevin B Kenny <kennykb@acm.org> | 2005-04-26 16:32:52 (GMT) |
commit | 5b8e425f3c7e42cbfadf1182170b46dc555e6b04 (patch) | |
tree | 7a19141ec26da44862b9411e5ef3883ec50bfb28 /tests | |
parent | fee601196f3a3d37e48ca7a5ea763cd132e49cd6 (diff) | |
download | tcl-5b8e425f3c7e42cbfadf1182170b46dc555e6b04.zip tcl-5b8e425f3c7e42cbfadf1182170b46dc555e6b04.tar.gz tcl-5b8e425f3c7e42cbfadf1182170b46dc555e6b04.tar.bz2 |
Restored silent overflow/underflow to input conversions
Diffstat (limited to 'tests')
-rw-r--r-- | tests/expr.test | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/tests/expr.test b/tests/expr.test index 57cf08f..852175a 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.30.2.7 2005/03/15 19:41:46 kennykb Exp $ +# RCS: @(#) $Id: expr.test,v 1.30.2.8 2005/04/26 16:33:05 kennykb Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest @@ -5144,6 +5144,39 @@ test expr-29.2 {smallest representible number} {ieeeFloatingPoint} { [catch {convertToDouble -2.47032822920623e-324} result] \ $result } {0 0x8000000000000001 0 0x8000000000000001 0 0x8000000000000000} +test expr-29.3 {silent underflow on input conversion} {ieeeFloatingPoint} { + set v ? + list [scan 2.47032822920623e-324 %g v] $v +} {1 0.0} +test expr-29.4 {silent underflow on input conversion} {ieeeFloatingPoint} { + set v ? + list [scan -2.47032822920623e-324 %g v] $v +} {1 -0.0} + +test expr-30.1 {largest representible number} {ieeeFloatingPoint} { + list [catch {convertToDouble 1.7976931348623155e+308} result] \ + $result \ + [catch {convertToDouble 1.7976931348623157e+308} result] \ + $result \ + [catch {convertToDouble 1.7976931348623159e+308} result] \ + $result +} {0 0x7feffffffffffffe 0 0x7fefffffffffffff 0 0x7ff0000000000000} +test expr-30.2 {largest representible number} {ieeeFloatingPoint} { + list [catch {convertToDouble -1.7976931348623155e+308} result] \ + $result \ + [catch {convertToDouble -1.7976931348623157e+308} result] \ + $result \ + [catch {convertToDouble -1.7976931348623159e+308} result] \ + $result +} {0 0xffeffffffffffffe 0 0xffefffffffffffff 0 0xfff0000000000000} +test expr-30.3 {silent overflow on input conversion} {ieeeFloatingPoint} { + set v ? + list [scan 1.7976931348623159e+308 %f v] $v +} {1 Inf} +test expr-30.4 {silent overflow on input conversion} {ieeeFloatingPoint} { + set v ? + list [scan -1.7976931348623159e+308 %f v] $v +} {1 -Inf} # cleanup if {[info exists a]} { |