1 //---------------------------------------------------------------------------//
2 // Copyright (c) 2013-2014 Kyle Lutz <kyle.r.lutz@gmail.com>
4 // Distributed under the Boost Software License, Version 1.0
5 // See accompanying file LICENSE_1_0.txt or copy at
6 // http://www.boost.org/LICENSE_1_0.txt
8 // See http://boostorg.github.com/compute for more information.
9 //---------------------------------------------------------------------------//
11 #ifndef BOOST_COMPUTE_DETAIL_LITERAL_HPP
12 #define BOOST_COMPUTE_DETAIL_LITERAL_HPP
18 #include <boost/type_traits/is_same.hpp>
20 #include <boost/compute/types/fundamental.hpp>
27 std::string make_literal(T x)
30 s << std::setprecision(
31 #ifndef BOOST_NO_CXX11_NUMERIC_LIMITS
32 std::numeric_limits<T>::max_digits10
34 // We don't have max_digits10, so add 3 other digits (this is what is required for
35 // float, and is one more than required for double).
36 3 + std::numeric_limits<T>::digits10
42 if(boost::is_same<T, float>::value || boost::is_same<T, float_>::value){
49 } // end detail namespace
50 } // end compute namespace
51 } // end boost namespace
53 #endif // BOOST_COMPUTE_DETAIL_LITERAL_HPP