Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"1 == 1.001" yields True #46

Closed
rogerdc opened this issue Apr 24, 2019 · 5 comments
Closed

"1 == 1.001" yields True #46

rogerdc opened this issue Apr 24, 2019 · 5 comments
Labels
bug
Milestone

Comments

@rogerdc
Copy link
Contributor

@rogerdc rogerdc commented Apr 24, 2019

I tried to use an expression of
1 == 1.001
and it came back as True.

It looks like a problem with the order of the types in Comparison.CommonTypes.

Not sure how to fix it in Java, but I added a change to the list of CommonTypes and updated the GetMostPreciseType method. Also added unit tests for all the relational operators.

Pull request coming in momentarily.

@bijington

This comment has been minimized.

Copy link
Owner

@bijington bijington commented Apr 25, 2019

Blimey that is scary but an excellent find! Even more impressive that there is a fix for it :). Thank you for going to the effort of fixing it.

Once my laptop is finished updating itself I shall take a look at the PR and hopefully merge that straight in. I do feel it warrants a new version to cover this fix.

Regarding Java, this has become rather stale code and I am planning on removing it in the not so distant future. I may regret asking this question but are you using it at all? My plan is to provide cross platform support through the .NET Standard version that ships through nuget.

@bijington bijington added the bug label Apr 25, 2019
@bijington bijington added this to the Next Release milestone Apr 25, 2019
@rogerdc

This comment has been minimized.

Copy link
Contributor Author

@rogerdc rogerdc commented Apr 25, 2019

We're using the Nuget package in a .NET Core application, so we don't need the Java version fixed. Thanks!

bijington added a commit that referenced this issue Apr 25, 2019
Issue #46: "1 == 1.001" yields True
@bijington bijington modified the milestones: Next Release, v1.4.1 Apr 25, 2019
@bijington

This comment has been minimized.

Copy link
Owner

@bijington bijington commented Apr 25, 2019

This is now fixed in version v1.4.1 or via NuGet.

@bijington bijington closed this Apr 25, 2019
@rogerdc

This comment has been minimized.

Copy link
Contributor Author

@rogerdc rogerdc commented Apr 25, 2019

We just got it installed in our product, and it works! Thanks again!

@bijington

This comment has been minimized.

Copy link
Owner

@bijington bijington commented Apr 26, 2019

@rogerdc thank you for not only using the framework but also fixing the issue that you found!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.