Browse Source

* fix simplication of max(double,double) with both values being constants

florian 1 year ago
parent
commit
15398549a4
1 changed files with 2 additions and 2 deletions
  1. 2 2
      compiler/ninl.pas

+ 2 - 2
compiler/ninl.pas

@@ -2980,8 +2980,8 @@ implementation
                           else if (hp2.nodetype=realconstn) then
                           else if (hp2.nodetype=realconstn) then
                             begin
                             begin
                               { Both actual parameters are constants, so take
                               { Both actual parameters are constants, so take
-                                the smaller of the two right now }
-                              if (trealconstnode(hp).value_real < trealconstnode(hp2).value_real) then
+                                the larger of the two right now }
+                              if (trealconstnode(hp).value_real > trealconstnode(hp2).value_real) then
                                 result:=crealconstnode.create(trealconstnode(hp).value_real,resultdef)
                                 result:=crealconstnode.create(trealconstnode(hp).value_real,resultdef)
                               else
                               else
                                 result:=crealconstnode.create(trealconstnode(hp2).value_real,resultdef)
                                 result:=crealconstnode.create(trealconstnode(hp2).value_real,resultdef)