PLECS 3.4 Online Help

Rounding

Purpose

Round floating point signal to integer values

Library

Control / Math

Description

pict

This component rounds the value of a floating point signal on its input to an integer value. The rounding algorithm can be selected in the component parameter:

floor
The output is the largest integer not greater than the input, for example floor(1.7) = 1   and floor(- 1.3) = - 2  .
ceil
The output is the smallest integer not less than the input, for example ceil(1.3) = 2   and ceil(- 1.7) = - 1  .
round
The output is the integer nearest to the input, for example round(1.4) = 1  , round(- 1.3) = - 1   and round(- 1.5) = - 2  .
fixed
The output is the integer value of the input with all decimal places truncated, for example fixed(1.7) = 1   and fixed(- 1.7) = - 1  .

Parameter

Operation
The rounding algorithm as described above.

Probe Signals

Input
The block input signal.
Output
The block output signal.