sign.hpp 925 B

12345678910111213141516171819202122232425262728293031323334
  1. /*=============================================================================
  2. Copyright (c) 2001-2011 Joel de Guzman
  3. Copyright (c) 2001-2011 Hartmut Kaiser
  4. http://spirit.sourceforge.net/
  5. Distributed under the Boost Software License, Version 1.0. (See accompanying
  6. file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  7. =============================================================================*/
  8. #if !defined(SPIRIT_SIGN_MAR_11_2009_0734PM)
  9. #define SPIRIT_SIGN_MAR_11_2009_0734PM
  10. #if defined(_MSC_VER)
  11. #pragma once
  12. #endif
  13. #include <boost/math/special_functions/sign.hpp>
  14. namespace boost { namespace spirit { namespace detail
  15. {
  16. template<typename T>
  17. inline bool (signbit)(T x)
  18. {
  19. return (boost::math::signbit)(x) ? true : false;
  20. }
  21. template<typename T>
  22. inline T (changesign)(T x)
  23. {
  24. return (boost::math::changesign)(x);
  25. }
  26. }}}
  27. #endif