fix bug in handling unary minus node as uminus is not a valid dseries operation
parent
8fdf805f1f
commit
de573890b7
|
@ -342,7 +342,11 @@ elseif strcmp(node.node_type, 'UnaryOpNode')
|
||||||
% Only works if dseries supports . notation for unary op (true for log/diff)
|
% Only works if dseries supports . notation for unary op (true for log/diff)
|
||||||
% Otherwise, use: X = eval([node.op '(Xtmp)']);
|
% Otherwise, use: X = eval([node.op '(Xtmp)']);
|
||||||
try
|
try
|
||||||
X = Xtmp.(node.op);
|
if strcmp(node.op, 'uminus')
|
||||||
|
X = -Xtmp;
|
||||||
|
else
|
||||||
|
X = Xtmp.(node.op);
|
||||||
|
end
|
||||||
if any(isinf(X)) || ~isreal(X)
|
if any(isinf(X)) || ~isreal(X)
|
||||||
parsing_error(['Error applying ' node.op], line, node);
|
parsing_error(['Error applying ' node.op], line, node);
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue