I had a look through the code in `prefixedoutstream.hpp` and 
`prefixedoutstream_impl.hpp`.

Converting each output to a string causes the floating-point types to lose the 
type information needed by the `destination` stream to output the necessary 
precision.

I could imagine two solutions to the problem

1. Introduce 3 inline template specialisations for 
`util::prefixedoutstream::BaseLogic` for `float`, `double` and `long double`, 
each of which directly writes the `val` to the `destination` stream.
2. Use SFINAE on `BaseLogic` to write `val` directly to the `destination` if 
the type satisfies `std::is_floating_point`.

Any thoughts?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/mlpack/mlpack/issues/755#issuecomment-267335519
_______________________________________________
mlpack mailing list
[email protected]
http://knife.lugatgt.org/cgi-bin/mailman/listinfo/mlpack

Reply via email to