CoCoA:Sign

From ApCoCoAWiki

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