AdditionalSqrt
Backport #4396
@Esther-Devakirubai #4396 affects four files, while this backport only affects two. I guess there are some additional commits missing
Will check.
@Esther-Devakirubai #4396 affects four files, while this backport only affects two. I guess there are some additional commits missing
Will check.
@casella I see only 2 files being affected by this.
https://github.com/modelica/ModelicaStandardLibrary/commit/1be54b5edfd3370f0365cab256cbed62c40bc2bc
Please correct me if I am wrong.
@Esther-Devakirubai there are more commits in #4396 : https://github.com/modelica/ModelicaStandardLibrary/pull/4396/commits
but this PR only contains the contents of one of them.
@Esther-Devakirubai there are more commits in #4396 : https://github.com/modelica/ModelicaStandardLibrary/pull/4396/commits
but this PR only contains the contents of one of them.
Yes, the #4396 PR contains multple commits, but for some reason the cherry-picking only considered the first one
I don't get why
.sqrtand not justsqrt. sqrt(v) is defined as the square root if v is Real or Integer, which is the case here. @HansOlsson, why the leading dot?
There is a comment explaining that on the line: "Real, not complex sqrt".
Due to lookup sqrt in Modelica.ComplexMath will find the complex Modelica.ComplexMath.sqrt-function, which isn't desired here. The complex exp and log functions work around it by using Modelica.Math.exp and Modelica.Math.log
@casella Can this be approved and Merged?
There is a comment explaining that on the line: "Real, not complex sqrt".
Due to lookup
sqrtinModelica.ComplexMathwill find the complexModelica.ComplexMath.sqrt-function, which isn't desired here. The complex exp and log functions work around it by using Modelica.Math.exp and Modelica.Math.log
I previously assumed that built-in functions had precedence in the look-up process, so they could not be shadowed. I obviously missed Section 5.6.1.1 saying: "The builtin classes are put into the unnamed root of the class tree".
@casella Can this be approved and Merged?
Yes, please go ahead. Thanks!
@casella Can this be approved and Merged?
Yes, please go ahead. Thanks!
@casella You requested changes earlier, so you have to actually approve :)
@casella You requested changes earlier, so you have to actually approve :)
😅