Skip to content

Issue with larger scales? #58

@uklimaschewski

Description

@uklimaschewski

I'm currently working on using your excellent library for my EvalEx project.
While porting the acos() function, I came to some kind of rounding problems, I guess.
Given this code:

    MathContext mathContext = new MathContext(68, RoundingMode.HALF_EVEN);
    BigDecimal x = new BigDecimal("1", mathContext);
    BigDecimal acos = BigDecimalMath.acos(x, mathContext);

    System.out.println(acos.toPlainString());

it will not print 0 as expected, but it prints out 0.0000000000000000000000000000000000000000000000000000000000000000000000001

This only happens, when I use a scale >= 60 in the MathContext.

Is this a problem of big-math or BigDecimal?

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions