Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
18 lines (13 sloc) 429 Bytes

Float

NearlyEqual

Returns true if the difference between num1 and num2 is less than the default epsilon.

float positionX = 0.1001f;
Debug.Log(positionX.NearlyEqual(0.1f)); // true

Returns true if the difference between num1 and num2 is less than the supplied epsilon.

float positionX = 0.1001f;
float customEpsilon = 0.01f;
Debug.Log(positionX.NearlyEqual(0.1f, customEpsilon)); // true
You can’t perform that action at this time.