# Tcl Library Source Code

Check-in [ec7b5576d0]

 ```62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 ``` ``` # Other examples # # Subtraction set c [lb]::math::decimal::- \$a \$b[rb] puts [lb]::math::decimal::tostr \$c[rb] ; # => will output 8.0 # Why bother using this instead of simply expr? puts [expr {8.2 + .2}] ; # => will output 8.399999999999999 puts [expr {8.2 - .2}] ; # => will output 7.999999999999999 # See http://speleotrove.com/decimal to learn more about why this happens. [example_end] [section "API"] [list_begin definitions] [call [cmd ::math::decimal::fromstr] [arg string]] ``` ``` | | ``` ```62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 ``` ``` # Other examples # # Subtraction set c [lb]::math::decimal::- \$a \$b[rb] puts [lb]::math::decimal::tostr \$c[rb] ; # => will output 8.0 # Why bother using this instead of simply expr? puts [lb]expr {8.2 + .2}[rb] ; # => will output 8.399999999999999 puts [lb]expr {8.2 - .2}[rb] ; # => will output 7.999999999999999 # See http://speleotrove.com/decimal to learn more about why this happens. [example_end] [section "API"] [list_begin definitions] [call [cmd ::math::decimal::fromstr] [arg string]] ```