|
@@ -972,6 +972,23 @@ implementation
|
|
|
exit;
|
|
|
end;
|
|
|
|
|
|
+ {
|
|
|
+ -(-left*right) or -(left*-right) => right*left
|
|
|
+
|
|
|
+ this operation is always valid as reals do not use a two's complement representation for negative
|
|
|
+ numbers, -real means just flip the sign bit
|
|
|
+ }
|
|
|
+ if (left.nodetype=muln) and ((taddnode(left).left.nodetype=unaryminusn)) then
|
|
|
+ begin
|
|
|
+ result:=caddnode.create(muln,taddnode(left).right.getcopy,tunaryminusnode(taddnode(left).left).left.getcopy);
|
|
|
+ exit;
|
|
|
+ end;
|
|
|
+ if (left.nodetype=muln) and ((taddnode(left).right.nodetype=unaryminusn)) then
|
|
|
+ begin
|
|
|
+ result:=caddnode.create(muln,taddnode(left).left.getcopy,tunaryminusnode(taddnode(left).right).left.getcopy);
|
|
|
+ exit;
|
|
|
+ end;
|
|
|
+
|
|
|
{ --node => node
|
|
|
this operation is always valid as reals do not use a two's complement representation for negative
|
|
|
numbers, -real means just flip the sign bit
|