Skip to content

Exponentiation by (1.0,0.0) of COMPLEX is not identity. #76889

Open
@harishch4

Description

@harishch4

Complex exponentiation by real/complex 1.0 is not the identity.
GNU compiler & classic-flang perturbs the argument. Intel compiler does not. : https://godbolt.org/z/xTo9K1ceE

Program test_complex_expt
    Complex :: x(3),y(3),xpt(3)
    Real :: rpt(3)
    x(:) = (1234.0, 2345.0)
    xpt = [ 1, 2, 0]
    y = x ** xpt
    Print *,y(1)-x(1)
    rpt = [ 1, 2, 0]
    y = x ** rpt
    Print *,y(1)-x(1)
  End Program test_complex_expt

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIndicates an unexpected problem or unintended behaviorflangFlang issues not falling into any other categoryflang:runtime

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions