Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This hopefully resolves #59 by constraining the infimum in
cos
to [0, pi).It also changes (/) to improve behavior with zero end points (see #19 ). Before:
After:
For what it's worth, the new behavior is consistent with the Multiple Precision Floating-Point Interval (MPFI) library. Because there might be opinions, I didn't touch
1 / singleton 0.0
(e.g., #47), but MPFI does returnwhole
for that, rather than an exception.Also do you have any interest in defining
recip
in terms of(/)
? I thought there might be a reasonrecip
is defined as is, but if not, redefiningrecip
would fix #53.Finally, I am a novice to Haskell so all of this might benefit from a second set of eyes.
Thanks for the help and putting together this package!
Adam
EDIT: I am leaving this pull request open for now, but I also have a branch going:
https://github.com/massma/intervals/tree/adam-fork
of some (possibly opinionated and novice) changes I made to address the bugs I needed to for my application. So far this branch fixes #19, #47, #53, #59, #61. If you want any of these updates to be incorporated into
intervals
just let me know: I am happy to filter and edit the branch according to your preferences, and submit a fresh pull request!