Skip to content

Rounding Inexact Exception #7

Open
@csprogrammer001

Description

@csprogrammer001

I'm using QPFloat in my C# Winforms application, targeting .NET Framework 4.5.2 and building with Visual Studio 2017. The value of quad gets rounded to some value even when it shouldn't. If Quadruple.EnableInexactException is set to true then it throws that exception. Would greatly appreciate if you could look into this. Below is code to reproduce the issue and an attached screenshot of the values when debugging.

Type: Functional

Reproducible: Always

Expected Behaviour: quad equals 5.099 quad.ToString(); returns 5.099

Actual Behaviour: quad equals 0 quad.ToString(); returns 5.099000000000000198951966012828052

    System.Quadruple quad = 0;
    string mystring = "";

    private void setquad()
    {
        //   Quadruple.EnableInexactException = true;
        quad = 5.099;
        mystring = quad.ToString();
        Console.WriteLine(mystring);
    }

devenv_L7ZdvjRprX

Many Thanks.

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