-
Notifications
You must be signed in to change notification settings - Fork 9
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
Replace usage of approxEqual with isClose #46
base: master
Are you sure you want to change the base?
Conversation
201f68b
to
9406e15
Compare
2309014
to
d636eeb
Compare
What the heck ? Why is |
@John-Colvin : This is ready to go |
There's quite a lot of orthogonal changes here which could easily go in on their own, they are already cleanly separated as separate commits. |
This introduces a lot of magic Also, some uses of The tests should remain quite "tight" numerically speaking. |
I can raise a separate PR with those commits if you prefer.
That's what the deprecation note recommends. I originally added an |
3488bf7
to
17de79a
Compare
@John-Colvin : How do you prefer I split this ? Last commit can go in its own PR already, it's one line. Regarding |
IMO one way to look at how to split things is: "anything that is sensible to be reviewed separately, should be submitted separately". "Sensible" does some heavy lifting there, obviously in theory every of these Essentially the whole point is to reduce coupling without causing decoherence. |
Moved one of the commits to #49 , and took out the code removal as it's not strictly needed for this. @John-Colvin : The issue with the remaining giant commit is that I can't split it: |
As can be seen from the CI, actually |
approxEqual is deprecated, isClose is the replacement. We also update the CI to use GDC-12 which has a recent frontend, as gdc-11 has v2.076 which doesn't include `isClose`, but gdc-12 has `-Werror=deprecated` on by default.
Rebased |
@maxhaton can you take a look at this from a numerics point of view? |
Ping @maxhaton |
The changes are probably fine but being pedantic the chosen value for the max absolute difference is quite a bit more lenient than what is implied by approxEqual originally I think. |
@maxhaton : I simply followed https://dlang.org/changelog/2.091.0.html#isClose |
I think it should be 1e-5 instead - the changelog does not agree with the deprecation message and docs. Let's get this merged |
Let's get it right. If it should be 1e-5 then it should be 1e-5, I don't want to make all the tests massively more lenient. |
Ok. |
And a couple minor commits for things laying around.