Am 16.02.2024 um 15:57 schrieb James Richters via fpc-pascal:
So you are saying when constant propagation is on, an expression should have a 
different result than with constant propagation off?
The result of math when using constants MUST be the same as the result of 
identical math using variables.

There should never be a difference if I did my formula with hard coded 
constants vs variables.

   Const_Ans = 2.00000010627116630224
  Const_Ans1 = 2.00000010627116630224
    Var_Ans1 = 2.00000000000000000000

This should not be happening.

James

See my other post;

if the developer explicitly wants reduced precision, then this is what happens.
But the reduced precision should not come unexpectedly simply because the
compiler attaches type attributes to constants (which can't be easily explained),
and then the outcome of simple decimal arithmetic is incorrect.

So I have to disagree, sorry.

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to