Skip to content

Math.Round

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

This shard rounds the input floating-point number to the nearest integer.

Details

If the inputs with fractional parts that are greater than 0.5, the output will be rounded up. If the inputs with fractional parts that are less than 0.5, the output will be rounded down. If the inputs with fractional parts that are equal to 0.5, the output will be rounded to the nearest even number.

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

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

Examples

1
2
3
4
@f3(-0.95 4.0 7.54)
Math.Round | Log

Assert.Is(@f3(-1.0 4.0 8.0) true)