Re: Having difficulty getting a math expression to work



Schelte Bron <nospam@xxxxxxxxxx> writes:

Tcl 8.5

Program (part and base are integral):

set part [expr round(pow(2,1020))]
set base [expr {2*$part}]

puts [expr {100.0 * $part / $base}]
puts [expr {(double($part)/$base)*100}]

Output:

Inf
50.0

Best wishes -- Markus Triska.

.