Natural logarithm cannot be computed in Delphi const at compile time

118 Views Asked by At

As I understand a thumb rule for allowing expressions in Delphi constants is that the expression should be able to get evaluated in complile time.

So it's greatly unclear for me why the following is not allowed ([dcc64 Error] E2026 Constant expression expected):

const    
  SCAPEGOATALHPA = 2.0 / 3;
  SCAPEGOATCONST = 1.0 / ln(SCAPEGOATALHPA);

Is something that would prevent Delphi compute the natural logarithm of a constant float number? Or just a Delphi bug, as usual?

0

There are 0 best solutions below