(theta: Expression)
| 227 | test('e^{iπ/3} evaluates to an EXACT expression, not a float (Euler form)', () => { |
| 228 | // Regression: the Euler branch assembled the result with the `.add()`/ |
| 229 | // `.mul()` methods, which fold the exact cos/sin literals (1/2, √3/2) to |
| 230 | // machine floats — violating the evaluate-vs-N exactness contract. |
| 231 | const e = engine.parse('e^{i\\pi/3}').evaluate(); |
| 232 | // No decimal float appears in the serialization (exact radical/rational). |
| 233 | expect(e.toString()).toBe('1/2 + sqrt(3)/2i'); |
| 234 | expect(e.isSame(engine.parse('\\frac12 + \\frac{\\sqrt3}{2}i'))).toBe(true); |
| 235 | // .N() still numericizes. |
| 236 | const n = e.N(); |
no outgoing calls
no test coverage detected