EvalNumeric

Trait EvalNumeric 

Source
pub trait EvalNumeric {
    // Required method
    fn eval_numeric(&self, precision: u32) -> Result<Expression, MathError>;
}

Required Methods§

Source

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:

  1. Handle domain restrictions correctly (return error for invalid inputs)
  2. Preserve mathematical correctness (exact evaluation when possible)
  3. Use specified precision for floating-point operations
  4. NOT perform variable substitution (that’s evaluate_with_context()’s job)

Implementors§