bijington/expressive

"1 == 1.001" yields True

Closed this issue · 5 comments

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.

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.

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

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

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

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