util.h 562 B

12345678910111213141516171819202122232425
  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 COPYING.txt, 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