josdejong/mathjs

math.floor returns apparently wrong value for BigNumbers; possibly implement distinct epsilon for BigNumber operations?

Open

#2.608 geöffnet am 27. Juni 2022

Auf GitHub ansehen
 (12 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)JavaScript (1.298 Forks)batch import
featurehelp wanted

Repository-Metriken

Stars
 (13.832 Stars)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

hello,math floor maybe wrong

case 1: math.floor(math.bignumber("1234567890123456.9951").mul( math.bignumber(100)),0).toString()

is wrong , accept '123456789012345699' but '123456789012345700'

case2: math.floor(math.bignumber("1234567890123456.9951").mul( math.bignumber(100)),1).toString() is ok , value is : '123456789012345699.5'

Contributor Guide