1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-18 14:21:41 +00:00

[Mono] Approximate equality

This commit is contained in:
Aaron Franke
2019-04-01 18:13:38 -04:00
parent 7f7d97f536
commit c577ec6ae4
7 changed files with 53 additions and 34 deletions

View File

@@ -36,9 +36,9 @@ namespace Godot
return (int)Math.Round(s);
}
public static bool IsEqualApprox(real_t a, real_t b, real_t ratio = Mathf.Epsilon)
public static bool IsEqualApprox(real_t a, real_t b, real_t tolerance)
{
return Abs(a - b) < ratio;
return Abs(a - b) < tolerance;
}
}
}