Boost logo

Boost Users :

From: François Duranleau (duranlef_at_[hidden])
Date: 2005-11-29 21:52:38


On Tue, 29 Nov 2005, Alain Cormier wrote:

> I use boost 1.32 with VS 6.0 (sp5) on Windows2000.
>
> If I try this :
>
> int anIntValue(-0);
> std::cout << anIntValue << '\n';\
>
> I get : 0
>
> And, if I try this :
> boost::format formatTest("My test : %0.0f \n");
> double theValue(-0.0002);
> std::string theString = boost::io::str(formatTest % theValue);
>
> I get : "My test : -0"
>
> Is it the right behavior? I was expecting the same result (simply a 0).
> Maybe I am wrong...
>
> Thank you for any advise / suggestion.

Yes, it is expected to print that, because the value you print is not
zero, but a small negative value. Even if there is some rounding done, a
negative sign is usually left to indicate that.

-- 
François Duranleau
LIGUM, Université de Montréal
"Oh mighty one... Please forgive me for wanting to fulfil my biological
  purpose..."
                           - Robert Anton Wilson, _Prometheus Rising_, 1983

_______________________________________________
Boost-users mailing list
Boost-users_at_[hidden]
http://lists.boost.org/mailman/listinfo.cgi/boost-users


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net