Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

odd nth roots of negative numbers evaluate to NaN #210

Open
mdavis7168 opened this issue Oct 18, 2024 · 1 comment
Open

odd nth roots of negative numbers evaluate to NaN #210

mdavis7168 opened this issue Oct 18, 2024 · 1 comment

Comments

@mdavis7168
Copy link

Description

See title

Steps to Reproduce

Reproducible on the MathLive demo site:
Screenshot from 2024-10-18 11-32-52

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

@arnog
Copy link
Member

arnog commented Oct 18, 2024

To clarify:

ce.parse('(-1)^{1/3}').evaluate().print();
// -> -1

but

ce.parse('(-1)^{1/3}').N().print();
// NaN

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants