Numeric VIs and Functions

Owning Palette: Mathematics VIs, Programming VIs and Functions

Requires: Base Development System. This topic might not match its corresponding palette in LabVIEW depending on your operating system, licensed product(s), and target.

Use the Numeric VIs and functions to create and perform arithmetic and complex mathematical operations on numbers and to convert numbers from one data type to another. Use the VIs and functions on the Elementary and Special Functions and VIs palette to perform trigonometric and logarithmic functions.

Example

You also can access the following constants from this palette:

Palette ObjectDescription
Absolute ValueReturns the absolute value of the input.
AddComputes the sum of the inputs.
Add Array ElementsReturns the sum of all the elements in numeric array.
Compound ArithmeticPerforms arithmetic on one or more numeric, array, cluster, or Boolean inputs. To select the operation (Add, Multiply, AND, OR, or XOR), right-click the function and select Change Mode from the shortcut menu. When you select this function from the Numeric palette, the default mode is Add. When you select this function from the Boolean palette, the default mode is OR.
DBL Numeric ConstantUse the DBL numeric constant to pass a double-precision, floating-point numeric value to the block diagram. Set this value by clicking inside the constant with the Operating tool and typing a value.
DecrementSubtracts 1 from the input value.
DivideComputes the quotient of the inputs.
Enum ConstantUse the enumerated constant to create a list of string labels with corresponding integer values you can select on the block diagram.
Expression NodeUse the Expression Node to calculate expressions that contain a single variable. The following built-in functions are allowed in formulas: abs, acos, acosh, asin, asinh, atan, atanh, ceil, cos, cosh, cot, csc, exp, expm1, floor, getexp, getman, int, intrz, ln, lnp1, log, log2, max, min, mod, rand, rem, sec, sign, sin, sinc, sinh, sizeOfDim, sqrt, tan, tanh.
IncrementAdds 1 to the input value.
Machine EpsilonRepresents the round-off error for a floating-point number with a given precision. Use the machine epsilon constant to compare whether two floating-point numbers are equivalent.
MultiplyReturns the product of the inputs.
Multiply Array ElementsReturns the product of all the elements in numeric array. If numeric array is an empty array, the function returns a value of 1. If numeric array contains only one element, the function returns that element.
NegateNegates the input value.
Not A Number ConstantReturns the value NaN (not a number).
Numeric ConstantUse the numeric constant to pass a numeric value to the block diagram. Set this value by clicking inside the constant with the Operating tool and typing a value.
Quotient & RemainderComputes the integer quotient and the remainder of the inputs. This function rounds floor(x/y) to the nearest integer towards -inf.
Random Number (0-1)Produces a double-precision, floating-point number between 0 and 1. The number generated is greater than or equal to 0, but less than 1. The distribution is uniform.
Random Number (Range)Generates a random value from a specified range. Wire data to the upper bound or lower bound input to determine the polymorphic instance to use or manually select the instance.
Range Limits for TypeReturns the maximum and minimum values of the input data type.
ReciprocalDivides 1 by the input value.
Ring ConstantUse the ring constant to create a list of value pairs you can select on the block diagram. Each value pair consists of a numeric value and corresponding string label.
Round To NearestRounds the input to the nearest integer. If the value of the input is midway between two integers, the function returns the nearest even integer.
Round Toward -InfinityTruncates the input to the next lowest integer.
Round Toward +InfinityRounds the input to the next highest integer.
Scale By Power Of 2Multiplies x by 2 raised to the power of n.
SignReturns the sign of number.
SquareComputes the square of the input value.
Square RootComputes the square root of the input value.
SubtractComputes the difference of the inputs.


SubpaletteDescription
Complex FunctionsUse the Complex functions to create complex numbers from two values given in rectangular or polar and to break a complex number into its rectangular or polar components.
Conversion VIs and FunctionsUse the Conversion VIs and functions to convert data types.
Data Manipulation FunctionsUse the Data Manipulation functions to modify the data types used in LabVIEW.
Fixed-Point FunctionsUse the Fixed-Point functions to manipulate the overflow status of a fixed-point number.
Math & Scientific ConstantsUse the Math & Scientific Constants to create LabVIEW applications.
Scaling VIsUse the Scaling VIs to convert voltage readings to other temperature or strain units.

Example

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

 Open example  Find related examples