Expand description
Mathematical expression and numeric string tokenization, analysis, and parsing.
Structs§
- Math
Detection - Result of identifying a mathematical expression, relation, or numeral format.
- Parsed
Input - Metadata regarding a parsed numeric input string.
- Parsed
Number - Represents a parsed numerical value with formatting metadata and optional units.
Enums§
- Math
Token - Token representation in a mathematical expression.
- Number
Value - The semantic value of a parsed number or mathematical constant.
Functions§
- analyze_
input - Backward-compatible wrapper analyzing layout of a numeric string.
- detect_
math_ format - Detects whether
srepresents a mathematical expression (arithmetic, symbolic) or relation (equation, inequality, approximation, system). - detect_
numeric_ format - Detects whether
srepresents a numeric or base numeral format (Integer, Float,HexadecimalNumeral,BinaryNumeral, orOctalNumeral). - evaluate_
expression - Evaluates a math expression string with standard operator precedence.
- format_
scaled - Formats a scaled [
Integer] back into a string in the given base, respecting decimal places, integer width, and fractional width. - parse_
expr - Parses an expression with addition and subtraction.
- parse_
number - Backward-compatible wrapper parsing a numeric string to
f64. - parse_
power - Parses exponentiation operations (right-associative).
- parse_
primary - Parses primary tokens (numbers or parenthesized expressions).
- parse_
scaled - Backward-compatible wrapper parsing a scaled number.
- parse_
term - Parses a term with multiplication, division, integer division, and modulo.
- parse_
unary - Parses unary operators (
+or-). - tokenize_
expression - Tokenizes a mathematical expression string into a sequence of
MathTokens. - unicode_
vulgar_ fraction - Returns the numerator and denominator for Unicode vulgar fraction characters.