Check for negative numbers in sqrt
This commit is contained in:
parent
ba2ce6fa89
commit
88edf4b193
|
@ -39,6 +39,11 @@ void sqrtExecute(void)
|
|||
return;
|
||||
}
|
||||
|
||||
if (expr->u.real < 0.0) {
|
||||
abCalcRaiseError(abCalcComplexResultError, SQRT_NAME);
|
||||
return;
|
||||
}
|
||||
|
||||
abCalcExprRealSet(&result, sqrt(expr->u.real));
|
||||
|
||||
abCalcStackExprPop(NULL);
|
||||
|
|
Loading…
Reference in New Issue