Complex division (was Re: c/2995: __complex__ int typecasts maybe broken)
Joseph S. Myers
jsm28@cam.ac.uk
Thu May 8 15:39:00 GMT 2003
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
More information about the Gcc
mailing list