473,465 Members | 1,444 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

complex

gc
Hi,
Why didn't the committee propose a new type for complex numbers with
integer components?
thanks,
gc
Nov 13 '05 #1
6 2233

On Tue, 14 Oct 2003, gc wrote:

Why didn't the committee propose a new type for complex numbers with
integer components?


At first glance, I would ask: What semantics would you give complex
integer division? Would the identity (a == a/b*b + a%b) still hold?

But considering that you probably *could* give a reasonable answer,
my real answer would be: What use would complex integer math be to
anyone? Complex floating arithmetic is just barely useful to a
vocal minority as it is (IMHO); I don't think anyone really cares
at all about "complex integer" arithmetic!

And if nobody cares, and nobody would use it, why bother to put it
in the Standard?

-Arthur

Nov 13 '05 #2
gc <gu**********@yahoo.com> wrote:
Hi,
Why didn't the committee propose a new type for complex numbers with
integer components?


Because complex numbers always have a real and imaginary part *per
definitionem* - there aren't "complex integers" and you can't do
"complex counting", so why should the people working on the standard
come up with a type of numbers that even the mathematicans never
did conceive?
Regards, Jens
--
_ _____ _____
| ||_ _||_ _| Je***********@physik.fu-berlin.de
_ | | | | | |
| |_| | | | | | http://www.physik.fu-berlin.de/~toerring
\___/ens|_|homs|_|oerring
Nov 13 '05 #3
Je***********@physik.fu-berlin.de wrote:
gc <gu**********@yahoo.com> wrote:
Hi,
Why didn't the committee propose a new type for complex numbers with
integer components?


Because complex numbers always have a real and imaginary part *per
definitionem* - there aren't "complex integers" and you can't do
"complex counting", so why should the people working on the standard
come up with a type of numbers that even the mathematicans never
did conceive?
Regards, Jens


But the mathematicians did conceive of such numbers.
Complex numbers where both the real and imaginary parts are integers
are generally known as Gaussian integers.
Some more information about Gaussian integers can be found at
http://mathworld.wolfram.com/GaussianInteger.html

It is a fairly safe assumption that if you can think of a type of
number, some mathematician has already thought about it and written a
paper about them.

The reason Gaussian integers weren't included in the standard is most
likely that they are rarely used. There is not much reason to mandate
support for a feature that only a few programs will ever have any use
for, especially since it is not too difficult to write your own
functions to handle them.

Ordinary complex numbers are used much more often, so for those it made
more sense to have them as part of the language.
--
<Insert your favourite quote here.>
Erik Trulsson
er******@student.uu.se
Nov 13 '05 #4
Je***********@physik.fu-berlin.de writes:
gc <gu**********@yahoo.com> wrote:
Hi,
Why didn't the committee propose a new type for complex numbers with
integer components?


Because complex numbers always have a real and imaginary part *per
definitionem* - there aren't "complex integers" and you can't do
"complex counting", so why should the people working on the standard
come up with a type of numbers that even the mathematicans never
did conceive?
Regards, Jens


Actually, complex integers are a perfectly valid mathematical concept;
they're also known as Gaussian integers. See, for example,
<http://mathworld.wolfram.com/GaussianInteger.html>.

Gaussian integers aren't directly supported in C because there isn't
much demand for them.

--
Keith Thompson (The_Other_Keith) ks*@cts.com <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://www.sdsc.edu/~kst>
Schroedinger does Shakespeare: "To be *and* not to be"
Nov 13 '05 #5
gc
> On Tue, 14 Oct 2003, gc wrote:

But considering that you probably *could* give a reasonable answer,
my real answer would be: What use would complex integer math be to
anyone? Complex floating arithmetic is just barely useful to a
vocal minority as it is (IMHO); I don't think anyone really cares
at all about "complex integer" arithmetic!


Gaussian integers form an integral domain so division need have been
defined or could have been defined in a manner analogous to how the
division operator works for integers in C (the reminder theorem holds
for gaussian integers so I guess it shouldn't be a big deal, the
quotient could have been used).
And if nobody cares, and nobody would use it, why bother to put it
in the Standard?


Thats a valid point, for the sake of completeness perhaps, kindly
correct me if I am wrong but wasn't the unary + operator was
introduced for the same reason, I think hardly any coe uses the unary
+ operator. Gaussian integers would be of use for some people.
Nov 13 '05 #6
gc writes:
Thats a valid point, for the sake of completeness perhaps, kindly
correct me if I am wrong but wasn't the unary + operator was
introduced for the same reason, I think hardly any coe [?] uses the unary
+ operator. Gaussian integers would be of use for some people.


The missing unary plus causes an annoying asymmetry in the syntax. That is
not the case with the integer complex deal.
Nov 13 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Peter Olsen | last post by:
I want to define a class "point" as a subclass of complex. When I create an instance sample = point(<arglist>) I want "sample" to "be" a complex number, but with its real and imaginary...
21
by: Blair | last post by:
could someone PLEASE tell me why this doesn't work... ----------------------------------------- #include <complex> using namespace std; typedef complex<long double> cld; void main() { cld...
34
by: Pmb | last post by:
I've been working on creating a Complex class for my own learning purpose (learn through doing etc.). I'm once again puzzled about something. I can't figure out how to overload the assignment...
3
by: Arthur | last post by:
Spending the morning avoiding responsibilities, and seeing what it would take to color some complex numbers. class color_complex(complex): def __init__(self,*args,**kws):...
7
by: Schüle Daniel | last post by:
Hello I am trying to customize the handling of complex numbers what I am missing is a builtin possibility to create complex numbers in polar coordinates so first I wrote a standalone function...
3
by: Russ | last post by:
I'd like to get output formatting for my own classes that mimics the built-in output formatting. For example, >>> x = 4.54 >>> print "%4.2f" % x 4.54 In other words, if I substitute a class...
2
by: Arvid Requate | last post by:
Hello, I'd like to understand why the following code does not compile. It looks like a strangeness in connection with overload resolution for the <complex> header: The conversion operator...
1
by: perroe | last post by:
Hi I have a array of complex numbers that are stored in a simple double array. This is done since the array is part of an wrapper for an external C library, and the imaginary part of the first...
3
by: Klaas Vantournhout | last post by:
Hi all, I was wondering why there is one extra argument for the return values of complex functions. And why is this not the case with any other data type (except char) example : * In case...
9
by: void main | last post by:
I'm rather new to complex numbers in C and was wondering, how do I initialize a complex variable properly if the imaginary part is 0. I tried -------- #include <complex.h> float complex c...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.