FloatExtensions.cs 538 B

123456789101112131415161718192021222324252627
  1. namespace SRF
  2. {
  3. using UnityEngine;
  4. public static class SRFFloatExtensions
  5. {
  6. public static float Sqr(this float f)
  7. {
  8. return f*f;
  9. }
  10. public static float SqrRt(this float f)
  11. {
  12. return Mathf.Sqrt(f);
  13. }
  14. public static bool ApproxZero(this float f)
  15. {
  16. return Mathf.Approximately(0, f);
  17. }
  18. public static bool Approx(this float f, float f2)
  19. {
  20. return Mathf.Approximately(f, f2);
  21. }
  22. }
  23. }