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.

Details

If a sequence of floats was provided as input, the shard will truncate each element in the sequence and output a sequence.

If a sequence of vectors was provided as input, the shard will truncate each component in each vector in the sequence and output a sequence of vectors with each component in each vector truncated.

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)