Skip to content

floating point not fixed #5

Description

@DiedeGu

Hi Ecwyne,

I am using math.js in a package and am writing tests for it. Currently I require the package like this. api.use('ecwyne:mathjs'); . The package works but the two decimal addition tests fail while in the online demo the same addition gives a correct result. Am I using the package in the wrong way / Do I still need to require the mathjs package?

it('eval returns 0.3 for 0.1 + 0.2', function(){
expect(math.eval('0.1 + 0.2')).toBe(0.3);
});

it('select returns 0.3 for 0.1 + 0.2', function(){
expect(math.select(0.1).add(0.2).done()).toBe(0.3);
});

Thanks in advanced

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