-
-
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: Export iszero #19950
RFC: Export iszero #19950
Conversation
if it's exported, it needs to be documented and the docs should be in the stdlib, if they aren't yet |
The web UI is cumbersome for this stuff, particularly for editing multiple files, so I'll improve this a little later. I can also add a testset for it. |
Now with 200% more docs and tests! |
Does this need a NEWS item? |
Yes, a NEWS item would be good. |
(I was thinking that |
[ci skip]
That would be pretty neat. I could take a crack at that at some point, but it would probably be better as a separate PR so that this and #19949 can be merged in time for 0.6. |
@@ -159,6 +159,8 @@ Library improvements | |||
* `logging` can be used to redirect `info`, `warn`, and `error` messages | |||
either universally or on a per-module/function basis ([#16213]). | |||
|
|||
* `iszero` is now exported from `Base` ([#19950]). |
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.
This assumes that people already know what this function is.
New `iszero(x)` function to quickly check whether `x` is zero (or is all zeros, for an array) ([#19950]).
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.
Much, much better. I've gone with that. Thanks!
Actually, perhaps that optimization could be made in |
[ci skip]
|
||
@testset "iszero" begin | ||
# Numeric scalars | ||
for T in Iterators.flatten(subtypes.([AbstractFloat, Signed, Unsigned])) |
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 types should probably just be written out - there's a type SOE.Sgnd
defined in the core test that causes a failure here if it runs in the same worker
As mentioned by @stevengj in #19947, introduced in #17623.