448,773 Members | 1,777 Online
Need help? Post your question and get tips & solutions from a community of 448,773 IT Pros & Developers. It's quick & easy.

# complex

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

 P: n/a 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

 P: n/a gc 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

 P: n/a Je***********@physik.fu-berlin.de wrote: gc 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. -- Erik Trulsson er******@student.uu.se Nov 13 '05 #4

 P: n/a Je***********@physik.fu-berlin.de writes: gc 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, . Gaussian integers aren't directly supported in C because there isn't much demand for them. -- Keith Thompson (The_Other_Keith) ks*@cts.com San Diego Supercomputer Center <*> Schroedinger does Shakespeare: "To be *and* not to be" Nov 13 '05 #5

 P: n/a > 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

 P: n/a 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 discussion thread is closed

Replies have been disabled for this discussion.