Skip to content

Commit

Permalink
Fixed bug with undefined values in algebraic expressions.
Browse files Browse the repository at this point in the history
  • Loading branch information
flarn2006 committed Dec 3, 2016
1 parent 275cbf8 commit 41aacd7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion source/RpnInstruction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ RpnInstruction::Status RpnInstruction::Execute(std::vector<double> &stack) const
} else {
double &back = stack.back();
back = expr.Evaluate(back);
return S_OK;
return std::isfinite(back) ? S_OK : S_UNDEFINED;
}
default:
return S_UNDEFINED;
Expand Down

0 comments on commit 41aacd7

Please sign in to comment.