Skip to content

abstract complex? #33246

@Roger-luo

Description

@Roger-luo

I'm wondering if it is good to have AbstractComplex, I think this is pretty useful since there can be different representation format for complex number as well, and they should share some similar interface and be treated both as complex number. e.g

  1. complex number can be represented as radius and angle
  2. or in my case I would like to define a symbolic type for complex number, which will directly inherit most of the complex number interfaces and make a lot function "just work"
  3. in some cases we only use exp(theta*im), it only need one floating point or number.
  4. I believe there can be more...

on the other hand, currently use some traits might help, but this will make complex numbers different from other numbers...

PS. integers have Integer, real numbers have Real, but complex number have none... it is not fair :-)

Metadata

Metadata

Assignees

No one assigned

    Labels

    complexComplex numbersdesignDesign of APIs or of the language itselffeatureIndicates new feature / enhancement requests

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions