isCloseTo
constisCloseTo:DualFn<<T>(lhs,rhs,precision) =>boolean>
Defined in: packages/typegpu/src/std/boolean.ts:254
Checks whether the given elements differ by at most the precision value.
Checks all elements of lhs and rhs if arguments are vectors.
Example
Section titled βExampleβisCloseTo(0, 0.1) // returns falseisCloseTo(vec3f(0, 0, 0), vec3f(0.002, -0.009, 0)) // returns trueargument that specifies the maximum allowed difference, 0.01 by default.