Skip to content

Double → Int

Converts a double signal to an integer using a selectable rounding rule (truncate, round-to-nearest, floor, or ceil).

Category: Math

Keywords: cast, convert, conversion, round, floor, ceil, truncate, type

Ports

NameDirectionValue typeNotes
ininputdouble
outoutputint

Parameters

NameLabelTypeDefaultUnitsDescription
modeModeenum (Truncate (toward 0) / Round (nearest) / Floor / Ceil)0Rounding rule applied when converting the double input to an integer output.

Implemented in C++ class SimCompCtlDblToInt (components/control/CSim_comp_ctl_dbl_to_int/sim_comp_ctl_dbl_to_int.h).

Released under the MIT License.