josdejong/mathjs

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

Open

#2608 aperta il 27 giu 2022

Vedi su GitHub
 (12 commenti) (0 reazioni) (0 assegnatari)JavaScript (1298 fork)batch import
featurehelp wanted

Metriche repository

Star
 (13.832 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

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'

Guida contributor