Difference between revisions of "CoCoA:Sign"

From ApCoCoAWiki
(pushing XML rev. 1.46, again)
 
(No difference)

Latest revision as of 10:02, 24 October 2007

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