Ignore:
Timestamp:
Dec 30, 2010 11:32:05 AM (11 years ago)
Author:
toby
Message:

more fixes to validreal for small nums; add more RB control routines

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/sandbox/readexp.tcl

    r1032 r1106  
    294294            set digits 1
    295295        }
     296        if {$digits <= 0} {set digits 1}
    296297        if {$digits + $sign >= $length} {
    297298            # the number is much too big -- use exponential notation
     
    307308            set decimal [expr {$length - $digits - $sign - 1}]
    308309            set tmp [format "%#.${decimal}f" $value]
    309         } elseif {abs($value) < pow(10,2-$decimal) && $length > 6} {
     310        } elseif {abs($value) < pow(10,2-$decimal) && $length > 6 && $value != 0} {
    310311            # for small values, switch to exponential notation (2-$decimal -> three sig figs.)
    311312            set decimal [expr {$length - 6 - $sign}]
Note: See TracChangeset for help on using the changeset viewer.