Rounding
Operator Menu Location: Math Functions
Operator Bitmap:
Functional Description:
The Rounding operator determines the integer component of a floating-point value. It can be configured to round to the floor of the input value:
y = |x|
such that the floating-point input x is rounded to the largest integer less than x. For example, |4.9|ï€ = 4, |-5|ï€ = -5, and |-3.1|ï€ = -4. It can also be configured to round to the ceiling of the input value:
y = |x|
such that the floating-point input x is rounded to the smallest integer no less than x. For example, |4.4|ï€ = 5, |-5|ï€ = -5, and |-3.6|ï€ = -3.
The Rounding operator can also be configured to round towards zero, or
Alternatively, the operator can be configured to round to the nearest integer. Mathematically, the relationship can be expressed as:
y = |x+0.5|
Design Pad will issue an error upon processing if the input pin is not connected.
User-Defined Properties:
Object Name. A string label that identifies the operator
Rounding. The rounding behavior of the operator: floor, ceiling, towards zero, or towards nearest.
Comments: None.
See Also: Modulo