| 699 | if (op === 'Erf' || op === 'Erfc') { |
| 700 | const inner = limitAtPosInf(o1(e), x, ce, depth + 1); |
| 701 | if (!inner) return undefined; |
| 702 | if (inner.isInfinity === true) { |
| 703 | // Only a *signed* real infinity saturates. A directionless infinity |
| 704 | // (e.g. ComplexInfinity) has neither `isPositive` nor `isNegative` set — |
| 705 | // stay symbolic rather than defaulting to the +∞ branch (mirrors the |
| 706 | // Sqrt/Root guard above). |
| 707 | if (inner.isPositive === true) return op === 'Erf' ? ce.One : ce.Zero; |
| 708 | if (inner.isNegative === true) |
| 709 | return op === 'Erf' ? ce.number(-1) : ce.number(2); |
| 710 | return undefined; |
| 711 | } |
| 712 | if (isDefiniteValue(inner)) return ce.function(op, [inner]).evaluate(); |
| 713 | return undefined; |
| 714 | } |
| 715 | |
| 716 | return undefined; |
| 717 | } |
| 718 | |
| 719 | function limitRatioAtPosInf( |
| 720 | num: Expression, |
| 721 | den: Expression, |
| 722 | x: string, |