Boost logo

Boost :

From: Johan Råde (rade_at_[hidden])
Date: 2006-08-04 06:08:05


There were a few typos.
Here is the correct code.

const boost::uint32_t signbit_mask
      = binary_cast<boost::uint32_t>(1.0f)
      ^ binary_cast<boost::uint32_t>(-1.0f);

inline bool signbit_impl(float x)
{
      return binary_cast<boost::uint32_t>(x) & signbit_mask;
}

inline bool signbit_impl(double x)
{
      return signbit_impl(static_cast<float>(x));
}

inline bool signbit_impl(long double x)
{
      return signbit_impl(static_cast<float>(x));
}

--Johan Råde


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk