math_helper.cpp 292 B

1234567891011121314151617
  1. /*
  2. * DoRayMe - a quick and dirty Raytracer
  3. * Math helping functions
  4. *
  5. * Created by Manoël Trapier
  6. * Copyright (c) 2020 986-Studio.
  7. *
  8. */
  9. #include <math.h>
  10. #include <float.h>
  11. #include <math_helper.h>
  12. bool double_equal(double a, double b)
  13. {
  14. return fabs(a - b) < DBL_EPSILON;
  15. }