Skip to content

Small numbers result in an error #6

@esromneb

Description

@esromneb

I have a number 7.471E-35 occurring in my code. When I use the add() function from this library it incorrectly rounds or truncates this to 0:

node
Welcome to Node.js v14.18.1.
Type ".help" for more information.
> const {add} = require('sinful-math');
undefined
> b = 4.761E-35
4.761e-35
> add(b,0)
0
> b+0
4.761e-35
> 
  • Result: 0
  • Expected result: 4.761e-35

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions