https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118499

--- Comment #15 from Thomas Koenig <tkoenig at gcc dot gnu.org> ---
(In reply to kargls from comment #14)
> (In reply to anlauf from comment #13)
> > (In reply to kargls from comment #12)
> > > (In reply to Thomas Koenig from comment #9)
> > > > Question is, what should we permit...
> > > > 
> > > > For 'normal' operations, only unsigned op unsigned is permitted,
> > > > so unsigned**unsigned is obviously ok.
> > > > 
> > > > What about (integer|real|complex)**unsigned?
> > > > 
> > > > What about unsigned**integer?
> > > > 
> > > > Since exponentiation is special (and also does not involve
> > > > type conversion) my feeling is to allow it all.
> > > > 
> > > > Comments?
> > > 
> > > Agree with the others.  Supporting the above is fine.
> > > What about allowing unsigned**(real|complex)? The Fortran standard
> > > allows integer**(real|complex).
> > 
> > I would vote against this.  Mathematically, the result cannot be an
> > unsigned.
> 
> As I noted, the standard allows integer**(real|complex).
> 
> % cat a.f90
> program foo
>    integer u
>    real x
>    complex c
>    x = 1.25
>    u = 2
>    c = (1.25,3.14)
>    print *, u**x, u**c
> end program
> % gfcx -o z -std=f2018 a.f90 && ./z
>    2.37841415                (-1.35409331,1.95532227)
> 
> The result is not integer.  It literally is the expected
> mathematical expression exp((real|complex)*log(unsigned))

Do I understand correctly that the integer argument is promoted
to real first? This would be the sort of implicit conversion that
is generally excluded from UNSIGNED.

Reply via email to