Macaulay2 » Documentation
Packages » Macaulay2Doc » analytic functions » sign
next | previous | forward | backward | up | index | toc

sign -- sign (signum) function

Description

When x is real, then this returns 1 if it is positive, -1 if it is negative, and 0 if it is zero.

i1 : sign 5

o1 = 1
i2 : sign (-3)

o2 = -1
i3 : sign 0

o3 = 0

If x is complex and nonzero, then this returns $x/|x|$.

i4 : sign(-7*ii)

o4 = -ii

o4 : CC (of precision 53)

See also

Ways to use sign:

  • sign(Constant)
  • sign(Number)

For the programmer

The object sign is a method function.


The source of this document is in Macaulay2Doc/functions/sign-doc.m2:30:0.