compute-engine
compute-engine copied to clipboard
odd nth roots of negative numbers evaluate to NaN
Description
See title
Steps to Reproduce
Reproducible on the MathLive demo site:
Actual Result
E.g. (-1)^{1/3}, (-32)^{1/5} evaluate to NaN
Expected Result
(-1)^{1/3} should evaluate to -1, (-32)^{1/5} to -2
Environment
Is this a regression: did it use to work in a previous version?
Compute Engine version If using the cortexjs.io site, the version is displayed
at the bottom of the page. If using the library, the version is available as
window[Symbol.for('io.cortexjs.compute-engine')].version in the browser or by importing
version from the library.
MathLive version 0.101.1 ComputeEngine version 0.26.4
To clarify:
ce.parse('(-1)^{1/3}').evaluate().print();
// -> -1
but
ce.parse('(-1)^{1/3}').N().print();
// NaN