Skip to content

Commit

Permalink
Document "sign"
Browse files Browse the repository at this point in the history
  • Loading branch information
d-torrance committed Jan 20, 2025
1 parent 2fe9d89 commit 6042140
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions M2/Macaulay2/packages/Macaulay2Doc/functions.m2
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ load "./functions/setRandomSeed-doc.m2"
load "./functions/setupLift-doc.m2"
load "./functions/setupPromote-doc.m2"
load "./functions/show-doc.m2"
load "./functions/sign-doc.m2"
load "./functions/sin-doc.m2"
load "./functions/sinh-doc.m2"
load "./functions/smithNormalForm-doc.m2"
Expand Down
26 changes: 26 additions & 0 deletions M2/Macaulay2/packages/Macaulay2Doc/functions/sign-doc.m2
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
doc ///
Key
sign
(sign, Number)
(sign, Constant)
Headline
sign (signum) function
Usage
sign x
Inputs
x:Number
Outputs
:{ZZ,CC}
Description
Text
When @VAR "x"@ is real, then this returns 1 if it is positive, -1 if it
is negative, and 0 if it is zero.
Example
sign 5
sign (-3)
sign 0
Text
If @VAR "x"@ is complex and nonzero, then this returns $x/|x|$.
Example
sign(-7*ii)
///

0 comments on commit 6042140

Please sign in to comment.