- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Upgrading real numbers to complex
Upgrading real numbers to complex
Upgrading real numbers to complex
Hello,
I tried to write the following very simple model using OpenModelica 1.9.3
model testComplex
Complex i;
equation
i = 0.0;
end testComplex;
This model does not compile, whereas the Complex numbers class does have a constructor based on real numbers, so shouldn't the real number be automatically upgraded to Complex (0.0) ?
Also, the model with 0 (int) instead of 0.0 (real) should probably work.
What do you think ?
Besides, why is the "<>" operator not defined for complex numbers ?
Thank you,
François
Re: Upgrading real numbers to complex
No, the specification only talks about binary and unary operations. The overloaded constructor is not used in equality-equations.
Complex 3.2.2 contains an overloaded '<>'. 3.2.1 does not.
- sjoelund.se
- 1700 Posts
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Upgrading real numbers to complex