Boost logo

Boost :

From: Gennadiy Rozental (gennadiy.rozental_at_[hidden])
Date: 2004-07-27 01:11:56


> template<typename T>
> struct print_log_value {
> void operator()( std::ostream& ostr, T const& t )
> {
> if(std::numeric_limits<T>::is_specialized &&
> std::numeric_limits<T>::radix == 2)
> { // Show all possibly significant digits (for example, 17 for 64-bit
> double).
> ostr.precision(2 + std::numeric_limits<T>::digits * 301/1000);
> }
> ostr << t; // by default print the value.
> }
> };

Actually it's in my TODO list.

I consider using this solution after release.

Gennadiy.


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