-
-
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
doc: clarify that signbit(x)
corresponds to x < zero(x)
for nonzero x
#56591
Comments
What's the difference between this issue and the referenced issue #53964, please? The referenced issue contains remarks about other tricky values besides zero. |
The referenced issue concerns zero values, while this issue concerns nonzero values. |
I would argue that this is a true statement no matter what we document. Branch-cutting on If you want to check |
"Useless for generic code" is basically the same thing as "useless", though. That is, if Here's a concrete motivating example: I want to check whether an However, given the vague current state of the doc string (perhaps additionally encouraged by @mikmoore's laissez-faire stance), a package could in the future define a Clarifying the doc string should prevent such events and allow packages to rely on How about:
? |
Here's an example laissez-faire interpretation of
|
I disagree. The current documentation exactly says that: "Return true if the value of the sign of x is negative, otherwise false.". I agree with @mikmoore that Being a mathematical operation,
The definition of
|
I proposed language in #53964, but perhaps people would prefer that the docstring lay out a table:
To my point about "general use," this is a non-idiomatic use of
I agree with the sentiment, but julia> signbit(NaN64), signbit(0.0/0.0), signbit(-0.0/0.0), signbit(-(0.0/0.0))
(false, true, true, false) The choice of what specific |
Otherwise
signbit
is useless for generic code.Xref #53964, which discusses the case of zero
x
.The text was updated successfully, but these errors were encountered: