Sign Function

LabVIEW 2018 Help


Edition Date: March 2018
Part Number: 371361R-01
View Product Info

DOWNLOAD (Windows Only)


LabVIEW 2016 Help
LabVIEW 2017 Help
LabVIEW 2018 Help
LabVIEW 2019 Help
LabVIEW 2020 Help

Owning Palette: Numeric 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

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.

WAS THIS ARTICLE HELPFUL?

Not Helpful