W2012 Safety Warnings

Safety

when condition is a float; equality checks on floats are imprecise; prefer math.abs(x - y) < epsilon

When this occurs

This error is triggered when: when condition is a float; equality checks on floats are imprecise; prefer math.abs(x - y) < epsilon

Example error message

warning[W2012]: when condition is a float; equality checks on floats are imprecise; prefer math.abs(x - y) < epsilon

How to fix

Review the error message and check your code at the indicated location. The message describes what went wrong — fix the underlying issue it identifies.

Related errors

No related errors.