-
-
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
RFC: add complex-valued tests #2845
Conversation
Thanks. Please add as many as you can. Let's fix all the uncovered issues in here and then merge. |
Okay, there's a few more. I'll add more as I get time. |
I've included the ones which are supposed to "raise an invalid flag": some of these currently raise an error, e.g. julia> sinh(complex(0.0,Inf))
ERROR: DomainError()
in sinh at complex.jl:332 Is there a standard method for asserting an error in the tests? |
|
Ideally we need a way to check that the particular exception was raised, rather than a generic error. |
Here, we really need the feature that was requested earlier (was it @johnmyleswhite ?) that the tests should continue running even if certain tests fail, so that we can see all the failures. This would be especially useful in travis. |
This could be solved by using a more appropriate handler when needed, in fact this was exactly my reason for #2680. |
@andrioni Good point. |
Okay, that should be all of the functions. The only one which is incomplete is To make this a bit easier to incorporate, I could remove it from |
We can't merge this before all of these pass. Do you have time to look at and fix the implementations too? Also cc: @jiahao to help out. |
An alternate thing to do would be to put all these new tests in a new file. We certainly do not want to disable existing tests. Then we can keep fixing them and moving them to test/complex.jl. |
This also needs a rebase before merging, once the new tests are put in say, complex-bc.jl. |
I'm happy to help out with the implementations where I can, but some of them may be beyond my skill set. |
Okay, I've rebased, and removed the new tests from |
RFC: add complex-valued tests
To keep the consistency of the limits: julia> complex(1e-10,1e-10)^complex(1e-10,1e-10)
0.9999999976535324 - 2.189387912488976e-9im |
But as I said, The C99 standard isn't really specific, just saying (in a footnote):
|
# raise invalid flag | ||
@test_fails exp(complex(0.0,Inf) #complex(NaN,NaN) | ||
@test_fails exp(complex(0.0,-Inf) #complex(NaN,NaN) | ||
@test_fails exp(complex(5.0,Inf) #complex(NaN,NaN) |
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.
These lines lack closing parentheses.
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.
Yes, these were fixed by #2878.
I've started adding some tests for complex valued functions, to deal with branch cut issues (see #2843).
Currently just has tests for
sqrt
. All tests are taken from the maccsqrt
man page (it was the most specific).Some of these tests currently fail (which I guess is the point of doing them). I'm happy to add more functions (log, trig/inverse trig, etc.).