diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2021-01-28 10:42:05 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2021-01-28 10:42:05 (GMT) |
commit | 8d49123e73e1b0bbbf97cd212e88960772a9e166 (patch) | |
tree | b3753c3b36bfe5b8fb3203da20f2864e9981ea97 /tests/format.test | |
parent | 9c024d9d3bfcd6cee7c0a39492f7e1fd4f80192d (diff) | |
download | tcl-8d49123e73e1b0bbbf97cd212e88960772a9e166.zip tcl-8d49123e73e1b0bbbf97cd212e88960772a9e166.tar.gz tcl-8d49123e73e1b0bbbf97cd212e88960772a9e166.tar.bz2 |
Use {} braces in more "expr" expressions.
Diffstat (limited to 'tests/format.test')
-rw-r--r-- | tests/format.test | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/format.test b/tests/format.test index 11cb4b7..20006ef 100644 --- a/tests/format.test +++ b/tests/format.test @@ -460,7 +460,7 @@ test format-13.1 {tcl_precision fuzzy comparison} { set a 0.0000000000001 set b 0.00000000000001 set c 0.00000000000000001 - set d [expr $a + $b + $c] + set d [expr {$a + $b + $c}] format {%0.10f %0.12f %0.15f %0.17f} $d $d $d $d } {0.0000000000 0.000000000000 0.000000000000110 0.00000000000011001} test format-13.2 {tcl_precision fuzzy comparison} { @@ -471,7 +471,7 @@ test format-13.2 {tcl_precision fuzzy comparison} { set a 0.000000000001 set b 0.000000000000005 set c 0.0000000000000008 - set d [expr $a + $b + $c] + set d [expr {$a + $b + $c}] format {%0.10f %0.12f %0.15f %0.17f} $d $d $d $d } {0.0000000000 0.000000000001 0.000000000001006 0.00000000000100580} test format-13.3 {tcl_precision fuzzy comparison} { @@ -480,7 +480,7 @@ test format-13.3 {tcl_precision fuzzy comparison} { catch {unset c} set a 0.00000000000099 set b 0.000000000000011 - set c [expr $a + $b] + set c [expr {$a + $b}] format {%0.10f %0.12f %0.15f %0.17f} $c $c $c $c } {0.0000000000 0.000000000001 0.000000000001001 0.00000000000100100} test format-13.4 {tcl_precision fuzzy comparison} { @@ -489,7 +489,7 @@ test format-13.4 {tcl_precision fuzzy comparison} { catch {unset c} set a 0.444444444444 set b 0.33333333333333 - set c [expr $a + $b] + set c [expr {$a + $b}] format {%0.10f %0.12f %0.15f %0.16f} $c $c $c $c } {0.7777777778 0.777777777777 0.777777777777330 0.7777777777773300} test format-13.5 {tcl_precision fuzzy comparison} { @@ -498,7 +498,7 @@ test format-13.5 {tcl_precision fuzzy comparison} { catch {unset c} set a 0.444444444444 set b 0.99999999999999 - set c [expr $a + $b] + set c [expr {$a + $b}] format {%0.10f %0.12f %0.15f} $c $c $c } {1.4444444444 1.444444444444 1.444444444443990} @@ -534,7 +534,7 @@ for {set i 0} {$i < 290} {incr i} { append b $a } for {set i 290} {$i < 400} {incr i} { - test format-16.[expr $i -289] {testing MAX_FLOAT_SIZE} { + test format-16.[expr {$i -289}] {testing MAX_FLOAT_SIZE} { format {%s} $b } $b append b "x" |