josdejong/mathjs

[BUG] error when handling coefficients with fractions

Offen

#2.594 geöffnet am 11.06.2022

 (6 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)JavaScript (1.314 Forks)batch import
featurehelp wanted

Repository-Metriken

Stars
 (15.065 Sterne)
PR-Merge-Metriken
 (PR-Metriken ausstehend)

Beschreibung

Steps to reproduce:

  1. URL encode simplify('w/5-(2w+3)/2-3w/5') to simplify%28%27w%2F5-%282w%2B3%29%2F2-3w%2F5%27%29 using any URL encoder (I used https://www.urlencoder.io/).
  2. Hit https://api.mathjs.org/v4/?expr=simplify%28%27w%2F5-%282w%2B3%29%2F2-3w%2F5%27%29 in the address bar in any web browser (I'm using Google Chrome).
  3. Got output w * -2 / 5 + (-(2 * w) - 3) / 2.

Expected output: $$\frac{w}{5}-\frac{2w+3}{2}-\frac{3w}{5} = -\frac75w-\frac32$$

Contributor Guide