Re: What should std::cout << std::numeric_limits<double>::infinity
() print?
On 6/4/2010 8:25 AM, Stuart Redmann wrote:
On 6/4/2010 4:12 AM, Stuart Redmann wrote:
[snipped question:
What should
std::cout<< std::numeric_limits<double>::infinity ();
print?]
On 4 Jun., 14:05, Victor Bazarov wrote:
I don't think the Standard specifies any particular output if the value
is one of "special" values, like infinity, minus infinity, not-a-number.
[snip]
The 1999 C standard says that an infinity
value should output [-]inf or [-]infinity, defined by the
implementation.
That's what I guessed. Wouldn't it be a good idea to incorporate some
standard behaviour for "special" floating point values into the
upcoming C++0x standard, too?
Personally, I don't really care. Outputting infinity or not-a-number is
not something I need often. And if I had to do it, I'd find a way,
without adding to the endless list of small things the Committee has to
look at. A simple comparison (with itself for NaNs) and a custom output
(of a string) should be sufficient.
If you feel up to it, write it up, submit to 'comp.std.c++'... The steps
for making a proposal are not secret. Don't count on succeeding in
adding it to the upcoming Standard, though. The work on it is pretty
much done.
V
--
I do not respond to top-posted replies, please don't ask