The eval( command, given an expression that evaluates to a real number, returns the string representation of that number.
eval(1337 //returns "1337" eval(2.0-3.0 //returns "‾1" eval(.0001234 //returns "1.234ᴇ‾4"
eval( has more limitations than the toString( command. It cannot handle lists, matrices, or complex numbers (even when the imaginary part of the complex number is zero). Another difference from toString( is that eval( is unaffected by display mode changes like Fix.
Use eval( in conjunction with expr( to evaluate a real expression in a string and return the answer in a string.
3.14->X eval(expr("2X+3 //returns "9.28"
- ERR:DATA TYPE is thrown when the expression contains a list, matrix, imaginary number, or string.
- ERR:SYNTAX is thrown when trying to evaluate a command that doesn't return a value.