The calling sequence in ?complex states only the two argument form 'Complex(x, y)', but later in the section "Description", in a bit confusing way, two rules for the single argument form are stated:

The Complex(x, y) constructor function returns the following types of objects for the indicated values of x and y.
          * x if x is already of type complex and y is not included in the calling sequence.
          * a one argument complex number (I*x) if x is an extended numeric and y is not included in the calling sequence.

And the first example is:

Complex(2);
                                     2 I

But 2 is an example of an object both type 'complex' and 'extended_numeric':

type(2,complex);type(2,extended_numeric);

                                 true
                                 true

If I understand this correctly, there is a contradiction between both rules. After the first one it should be:

Complex(2);
                                     2 

I do not see an explanation or justification for this choice of the second rule.

Now, I find that the current behavior (ie the use of the second rule) seems mathematically inconsistent. I would expect this 'Complex' constructor to represent the inclusion R subset C. Ie map a syntactically real object like 2 into its complex counterpart (ie 2+0*I). But instead, it maps an object repesenting a point on the real axis to a point on the imaginary axis.


Please Wait...