Back to Symbolic Math (SymEngine)
sym.numer
Extracts the numerator of a rational expression.
Syntax
sym.numer(expr)
Description
Extracts the numerator of a rational expression. For an expression representing a fraction p/q, returns p. For non-fractional expressions, returns the expression itself (since any expression can be viewed as itself over 1).
Parameters
| Name | Description |
|---|---|
| expr | - The expression to extract the numerator from. |
Returns
Expr