josdejong/mathjs

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

Aperta

#1724 aperta il 27 gen 2020

 (7 commenti) (0 reazioni) (0 assegnatari)JavaScript (1314 fork)batch import
bughelp wanted

Metriche repository

Star
 (15.065 stelle)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

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.

Guida contributor