-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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 #12375 (fix scaling of isapprox) #12393
Conversation
6bb3070
to
52e7171
Compare
Interesting win32 failure. |
Hmm, this is the third time I see this happen so it might be something real. First appears on Matt's PR after the Win64 freeze is fixed. See #12248 (comment) |
I restarted the build and the failing Win32 build is here https://ci.appveyor.com/project/StefanKarpinski/julia/build/1.0.7480/job/ft5fu5cod5w7jl77 |
On an unrelated note, the keywords in this function are |
While I generally like short names, I must confess that it took me a while to figure out what |
Rebased (after |
@StefanKarpinski, I prefer the longer names in this case. If you google "reltol" and "abstol" you'll see that these abbreviations are pretty common for relative and absolute tolerances, whereas googling "rtol" and "atol" produce completely unrelated results. But backwards compatibility for a keyword rename seems a little tricky? I guess you could do:
? |
(The |
I think that's as good as it gets – deprecating keywords is pretty ugly. |
fix #12375 (fix scaling of isapprox)
One thing to point out is that |
@timholy, If you are comparing two arrays, a more reasonable comparison is |
I would say that FactCheck's |
Agreed. |
As discussed in #12375,
isapprox(x,y)
had default tolerances that were dimensionally incorrect: if you multiply bothx
andy
by 10, the relative tolerance should be unchanged while the absolute tolerance should multiply by 10. The new implementation fixes this issue, and is also greatly simplified:sqrt(eps(T))
whereT
comes from promotingx
andy
, for floating-point types, or zero for other types.Number
type that definesreal(T)
to get the corresponding real type, along withabs
andisfinite
and-
.