-
Notifications
You must be signed in to change notification settings - Fork 28
Fix overflow for Midpoint #28
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
Fix overflow for Midpoint #28
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR looks good to me.
Should we just use
NumOps
for allInterpolate
implementations @jturner314?
I don't think so, because e.g. Lower
and Higher
don't need to do any arithmetic. The reason why we have an Interpolate
trait anyway is to minimize the trait bounds on the element types. (Otherwise, if we require the same trait bounds for all element types, we might as well just replace all the the types that implement Interpolate
with a single enum.)
Sorry, my wording was not precise. I meant using |
Oh, I understand now. Sure, requiring By the way, thanks for taking care of this issue! |
I am actually quite thrilled that this crate has its first legit user (and bug report, as it often goes) 🚀 |
I have added the NumOps trait constraint - I'll squash and merge. |
This provides a fix for #27, I have also included a test to reproduce the issue so that we can be aware of regressions.
Unfortunately, it's a breaking change PR because I have had to add
Sub
to the trait bound. Should we just useNumOps
for allInterpolate
implementations @jturner314?