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
Should Approx be more generic? #1467
Comments
Another problem, double is at exp level precision, while int and fix-pointer is at the linear level, which makes Approx not that "Approx", and also makes the a relative comparison take no effects for int / fixed-point types. |
@horenmar PTAL |
I'd like a feature like this too. Currently I'm using a hand-rolled implementation which uses the Matcher API and the existing Approx implementation:
This is skewed towards my use cases of
Maybe it can be useful in highlighting some generally applicable features. For example in the same way that
but I can also specify margin as a raw double, as kilos, etc. Also note that I've provided a This may require a customization point of some sort. In my units example above, the library provides mathematical functions such as |
Currently Approx only supports types that can be converted to double.
However, For fixed-point numbers, or fuzzy match strings, Approx should also work. But it requires the user to customize their specific version.
I 'd be happy if Approx provide a template parameter and default to double. It will make Approx more usable.
Would you be ok with a PR related to this?
The text was updated successfully, but these errors were encountered: