[cfp-interest 3368] removing imaginary I

Jim Thomas jaswthomas at sbcglobal.net
Sat Feb 8 07:12:37 PST 2025


I want to include in the CFP agenda for February 12 a look at N3390 “Remove the imaginary I” and the ensuing WG14 email thread. Does CFP have any input for WG14 about the proposal? Following are a couple of things I noticed.

The proposal optionally adds a constant identifier I declared with 1.0i, to support existing code that uses the I macro. If the constant identifier I is desired it should be declared with 1.0fi rather than 1.0i, to match the type of the I macro. 

The proposal mentions that users who want to use the macro I can add

#include <complex.h>
#define I _Complex_I

I think it would be helpful to note this in the standard if the macro I is removed or obsolesced.

The proposal modifies the cproj(z) specification in 7.3.9.5 to replace the I with 1.0i in the expression given as equivalent to cproj(z). (1.0i instead of 1.0fi is ok here since the expression type is double anyway.) The entire expression should be changed to

CMPLX(INFINITY, copysign(0.0, cimag(z)))

(because the current and suggested expressions would be affected by expression evaluation methods whereas the cproj function would not). This is addressed in a coming CFP proposal.

- Jim Thomas


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.oakapple.net/pipermail/cfp-interest/attachments/20250208/3e42905d/attachment.htm>


More information about the cfp-interest mailing list