-
-
Notifications
You must be signed in to change notification settings - Fork 55
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
RealAbs and RealSign #885
RealAbs and RealSign #885
Conversation
<dd>returns $-1$, $0$ or $1$ depending on whether $x$ is negative, | ||
zero or positive. | ||
</dl> | ||
'RealSign' is also known as $sgn$ or $signum$ function. |
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.
If it is signum, we should add that before the WMA link a wikipedia link: https://en.wikipedia.org/wiki/Sign_function
mathics/eval/testing_expressions.py
Outdated
@@ -6,10 +6,12 @@ | |||
from mathics.core.expression import Expression | |||
from mathics.core.systemsymbols import SymbolDirectedInfinity | |||
|
|||
|
|||
# TODO: Remove me. The following function is not used anywhere |
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.
If it is not used, please remove it. It will live pretty much forever in git.
LGTM - just small comments about documenting RealSign and the placement of the new builtins. Merge whenever you feel ready. |
I see RealSign and RealAbs under Numerical Functions not Testing Expressions |
<dt>'RealAbs[$x$]' | ||
<dd>returns the absolute value of a real number $x$. | ||
</dl> | ||
'RealAbs' is also known as modulus. It is evaluated if $x$ can be compared \ |
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.
Same comment about Wiki reference.
Right now, they are under |
Regarding the place, and to reduce the noise, I prefer to keep |
<url>:WMA link:https://reference.wolfram.com/language/ref/RealAbs.html</url> | ||
|
||
<url> | ||
:Signum: |
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.
The link name should be what Wikipedia calls it, so this should be "Sign function". Wikipedia mentions that this is also called "Signum"
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.
Ok, I can change this in another iteration.
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.
I have included that change in #886, which is the next round of patches.
This PR implements two new builtins. Also, its low-level implementation is used to simplify some of the low-level eval functions in arithmetic and testing expressions.