Skip to content

Math.FastInvSqrt

Name Mandatory Description Default Type
⬅️ Input The input float or sequence of floats to calculate the inverse square root of. This value must be a positive number or sequence of positive numbers. FloatFloat2Float3Float4Color[Any]
Output ➡️ Outputs the inverse square root of the input. FloatFloat2Float3Float4Color[Any]

This shard calculates the inverse square root of the given input.

Details

This shard calculates the inverse square root of a number fast like Math.FastSqrt, at the cost of accuracy. For most everyday numbers, the difference is negligible. The difference is more pronounced for very large numbers, very small numbers, or numbers very close to perfect squares.

If a sequence of floats was provided as input, the shard will calculate the inverse square root of each element in the sequence and output a sequence.

If a sequence of vectors was provided as input, the shard will calculate the inverse square root of each component in each vector in the sequence and output a sequence of vectors where each component in each vector is the inverse square root of the corresponding component in the input sequence.

Examples

1
2
3
4.0 | Math.FastInvSqrt | Log
Math.Subtract(0.4999978) | Math.Abs
IsLess(0.00001) | Assert.Is(true Break: true)

[info] [sample-wire] 0.499998