Skip to content

Library is broken #5

@sublimator

Description

@sublimator
Assert.AreEqual(16, 
               BigDecimal.Parse("9999,9999,9999,9999".Replace(",", ""))
                           .StripTrailingZeros().Precision);

It fails, with the actual value being 17 ... Yikes! Something to do with StripTrailingZeros ...

I've also seen issues with unnecessary rounding, when Parsing strings with a MathContext with a precision of 16, and where there's only been 16 digits. Probably negative numbers, cause I've seen negative numbers created using a big integer constructor, with a Precision of 17 when there's clearly only 16 digits, and that when you Abs() the value the Precision is 16.

I'm using <package id="dmath" version="1.5.66" targetFramework="net45" />

I feel like this package needs a lot more testing? I don't really have the time at the moment.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions