josdejong / josdejong/mathjs

Rationalize giving error on 1/(x^-2)

Open
#1,724 7 comments 0 reactions 0 assignees View on GitHub
bug help wanted
Dominant language
JavaScript
Stars
15.1k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Description

Running
```math.rationalize('1/(x^-2)')```
gives the error
```Cannot read property '1' of undefined```.

However, running
```math.rationalize('1/(x^-1)')```
gives the result `x` as you'd expect.

I'm using `mathjs 6.5.0`. Haven't tested other versions.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.