This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Complex division (was Re: c/2995: __complex__ int typecastsmaybe broken)
- From: "Joseph S. Myers" <jsm28 at cam dot ac dot uk>
- To: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- Cc: Dara Hazeghi <dhazeghi at yahoo dot com>, gcc at gcc dot gnu dot org
- Date: Thu, 8 May 2003 16:39:09 +0100 (BST)
- Subject: Re: Complex division (was Re: c/2995: __complex__ int typecastsmaybe broken)
- References: <20030508084601.29157.qmail@sources.redhat.com><Pine.LNX.4.53.0305080951210.25021@kern.srcf.societies.cam.ac.uk><m3ptmtjz2p.fsf_-_@uniton.integrable-solutions.net>
On Thu, 8 May 2003, Gabriel Dos Reis wrote:
> Like Joe suggested, deprecating only the problematic operations should
> be sufficient. There are uses of "__complex__ integer-type" in Number
Complex integer division is problematic - except that you can easily
produce meaningful modulo and division operations in the Gaussian
integers, the problem is defining a unique one that is sensible for C
(still more problematic to get one that is also consistent with the
unfortunate modulo definition for integers in C99) and sensibly
implementable. Complex integer multiplication is also problematic
(overflow of intermediate expressions) until we have the facility to mark
individual operations (generated from the multiplication) as
overflow-defined/undefined. You could deprecate both - but then complex
integer operations would be of even less use. I doubt that the built-in
complex integer facilities are likely to be what anyone making
mathematical use of the Gaussian integers would be likely to use.
(Complex integers also require GCC to define its own ABI and debug
representations, and I'm not aware of these being documented anywhere.
DWARF3 defines entries for complex (and imaginary) floating point types,
as used by C99 and other languages - but not for complex integers.)
--
Joseph S. Myers
jsm28@cam.ac.uk