CoCoA:Sign

From ApCoCoAWiki
Revision as of 10:02, 24 October 2007 by XMLBot (talk | contribs) (pushing XML rev. 1.46, again)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Sign

the sign of a number

Description

This function returns -1 if X < 0, 0 if X = 0, and 1 if X > 0.

X must be INT or RAT.

Example

  Sign(123);
1
-------------------------------
  Sign(-5/2);
-1

Syntax

Sign(X:INT of RAT):INT