Skip to content

Math.Trunc

Name Mandatory Description Default Type
⬅️ Input The input float or sequence of floats to truncate. FloatFloat2Float3Float4Color[Any]
Output ➡️ Outputs the input truncated to the nearest integer (as a float). FloatFloat2Float3Float4Color[Any]

This shard truncates the input floating-point number towards zero, removing any fractional part without rounding.

Examples

1
2
@f3(-0.95 4.0 7.54) | Math.Trunc | Log
Assert.Is(@f3(0 4 7) Break: true)

[info] [sample-wire] @f3(-0 4 7)