pub trait EvalNumeric {
// Required method
fn eval_numeric(&self, precision: u32) -> Result<Expression, MathError>;
}Required Methods§
Sourcefn eval_numeric(&self, precision: u32) -> Result<Expression, MathError>
fn eval_numeric(&self, precision: u32) -> Result<Expression, MathError>
Evaluate expression to numerical form
§Arguments
precision- Number of bits of precision for numerical operations (default: 53 for f64)
§Returns
Expression in numerical form (may contain Number, Complex, Matrix of numbers, etc.)
§Errors
Returns MathError for:
- Domain violations (sqrt of negative, log of zero, etc.)
- Undefined operations (0/0, inf-inf, etc.)
- Numerical overflow/underflow
§Implementation Requirements
Implementations MUST:
- Handle domain restrictions correctly (return error for invalid inputs)
- Preserve mathematical correctness (exact evaluation when possible)
- Use specified precision for floating-point operations
- NOT perform variable substitution (that’s
evaluate_with_context()’s job)