TABLE OF CONTENTS


::pwtk::evalExpr

SYNOPSIS

proc ::pwtk::evalExpr {expression} {

PURPOSE

Evaluate expression and return its value. For integer expression, integer value is returned; for real expression, real value is returned. Beware that fortran "D" exponential syntax, i.e 1.0d0, is taken care of.

SOURCE

    if { [is_int $expression] } {
        return [expr $expression]
    } elseif { [is_double $expression] } {
        return [mathParser $expression]
    } else {
        return $expression
    }
}