Module limits

Module limits 

Source
Expand description

Limit evaluation for mathematical expressions.

This module provides functions for computing limits of expressions as a variable approaches a specific value.

§Overview

The limit module supports:

  • Direct substitution for continuous functions
  • Detection of indeterminate forms (0/0, ∞/∞, etc.)
  • Limits at infinity
  • One-sided limits (left and right)
  • Common special limits (sin(x)/x, etc.)

§Examples

§Direct Substitution

use thales::limits::{limit, LimitPoint};
use thales::parser::parse_expression;

// lim_{x->2} x^2 = 4
let expr = parse_expression("x^2").unwrap();
let result = limit(&expr, "x", LimitPoint::Value(2.0));
// Returns Ok with value 4.0

§Limit at Infinity

use thales::limits::{limit, LimitPoint};
use thales::parser::parse_expression;

// lim_{x->∞} 1/x = 0
let expr = parse_expression("1/x").unwrap();
let result = limit(&expr, "x", LimitPoint::PositiveInfinity);

Enums§

IndeterminateForm
Types of indeterminate forms.
LimitError
Error type for limit evaluation failures.
LimitPoint
The point that a limit approaches.
LimitResult
Result of a limit evaluation.

Functions§

limit
Evaluate the limit of an expression.
limit_left
Evaluate limit from the left (approaching from below).
limit_right
Evaluate limit from the right (approaching from above).
limit_with_lhopital
Evaluate the limit using L’Hôpital’s rule when needed.