simlogo1

 

 

 

SimQuest 6.4 help

 

 

Sign

 

When applied to a number or an array of numbers, Sign produces the sign of the number or an array for each element of which is the sign of the corresponding element of the input array, respectively.
It has two variables: X and signX.

 

Structure (for scalars):

       if X > 0 then signX = 1

       if X < 0 then signX = -1

       otherwise signX = 0

 

Examples:

       sign(5) = 1

       sign(-3.2) = -1

       sign(0) = 0

       sign((5, -3.2, 0)) = (1, -1, 0)

 

 

 

Related topics:

 

 

 

Copyright University of Twente 2011