util.h 566 B

123456789101112131415161718192021222324
  1. /*-----------------------------------------------------------------------------
  2. | Copyright (c) 2013-2017, Nucleic Development Team.
  3. |
  4. | Distributed under the terms of the Modified BSD License.
  5. |
  6. | The full license is in the file LICENSE, distributed with this software.
  7. |----------------------------------------------------------------------------*/
  8. #pragma once
  9. namespace kiwi
  10. {
  11. namespace impl
  12. {
  13. inline bool nearZero(double value)
  14. {
  15. const double eps = 1.0e-8;
  16. return value < 0.0 ? -value < eps : value < eps;
  17. }
  18. } // namespace impl
  19. } // namespace kiwi