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

Add new more generic version of close in Expect #413

Open
rahicks26 opened this issue Mar 19, 2021 · 3 comments
Open

Add new more generic version of close in Expect #413

rahicks26 opened this issue Mar 19, 2021 · 3 comments

Comments

@rahicks26
Copy link

Currently, there is easy to check if two floats are close to each other, but it would be nice to add some new methods that extend this method and maybe a few other float specific to work with more types such as decimal and UoMs.

/// Rough v1.  Need to look at the other methods to make it compatible.
let inline close v1 v2 epsilon =
    let diff = (v1 - v2)
    let delta = abs diff
    delta < epsilon
@rahicks26
Copy link
Author

Would love to do a PR for something like this if it would be helpful.

@haf
Copy link
Owner

haf commented Mar 20, 2021

@rahicks26 Yes it would be helpful. :)

@rahicks26
Copy link
Author

Awesome I did a bit of a POC Friday. Should have a PR up around the end of this week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants