Sign Function

Owning Palette: Numeric VIs and Functions

Requires: Base Development System

Returns the sign of number.

Note  For nonzero complex numbers, this function returns a complex value with the same phase as the input and with a magnitude of 1.

Text-based programming languages typically call this function signum or sgn. The connector pane displays the default data types for this polymorphic function.

Example

 Add to the block diagram  Find on the palette
number can be a scalar number, array or cluster of numbers, array of clusters of numbers, and so on.
–1, 0, 1 returns 1 if the input value is greater than 0, returns 0 if the input value is equal to 0, and returns –1 if the input value is less than 0. When number is in the form of a + bi, that is, when number is complex, the following defines -1, 0, 1:

Example

Refer to the Numeric Functions VI in the labview\examples\Numerics directory for an example of using the Sign function.

 Open example  Find related examples