SGN

Contents


sgn returns the sign of a numeric parameter.

 

Syntax

   sgn(num_exp)

 

Parameters

Element

Description

Restrictions

num_exp

Numeric Expression

None

 

Examples

   CUBIC_ROOT = sgn(X) * abs(X) ^ (1/3)

 

Description and Comments

sgn(X) returns:
+1    if X is positive,   
0       if X is null,
-1     if X is strictly negative.

The result is of the Integer data type.

 

Associated Errors

Error

Description

ERMODE (10)

The parameter is not numeric.

 

Associated Keywords

ABS


CONTENTS


Copyright © Sage 1999 - 2007