Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.std.c++ > #307

Re: Text form of ::std:: complex

From Daniel Krügler<daniel.kruegler@googlemail.com>
Newsgroups comp.std.c++
Subject Re: Text form of ::std:: complex
Date 2011-09-25 08:27 -0700
Organization A noiseless patient Spider
Message-ID <j5n30k$bmv$1@dont-email.me> (permalink)
References <j5kivh$2bbe$1@news2.ipartners.pl>

Show all headers | View raw


Am 25.09.2011 06:47, schrieb Krzysztof Żelechowski:
>  Is there any reason why the text form of ::std:: complex is (u,v) and not
>  (u+v*i)?
>  The text form of fundamental types is human-readable and
>  intuitive, except for complex numbers.

Well, the criteria for intuition are not the only once that determine
such a decision, efficiency and simplicity have similar weights. Given
your alternative example, I would argue that "u+v*i" is even more
natural and I would expect that "v*i" just works as well. But given the
fact that C++ does not have direct support for imaginary numbers, the
current format decision is IMO a logical conclusion.

HTH&  Greetings from Bremen,

Daniel Krügler





-- 
[ comp.std.c++ is moderated.  To submit articles, try posting with your ]
[ newsreader.  If that fails, use mailto:std-cpp-submit@vandevoorde.com ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html                      ]

Back to comp.std.c++ | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Text form of ::std:: complex Krzysztof Żelechowski<giecrilj@stegny.2a.pl> - 2011-09-24 21:47 -0700
  Re: Text form of ::std:: complex Daniel Krügler<daniel.kruegler@googlemail.com> - 2011-09-25 08:27 -0700
    Re: Text form of ::std:: complex Krzysztof Żelechowski<giecrilj@stegny.2a.pl> - 2011-09-26 08:58 -0700
  Re: Text form of ::std:: complex Christopher Dearlove<christopher.dearlove@googlemail.com> - 2011-10-07 16:09 -0700

csiph-web