josdejong / josdejong/mathjs

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

Open
#2,608 12 comments 0 reactions 0 assignees View on GitHub
feature help wanted
Dominant language
JavaScript
Stars
15.1k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Description

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

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.