mirror of
https://github.com/jeremysrand/abCalc.git
synced 2024-05-28 12:41:34 +00:00
Check for negative numbers in sqrt
This commit is contained in:
parent
ba2ce6fa89
commit
88edf4b193
|
@ -39,6 +39,11 @@ void sqrtExecute(void)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (expr->u.real < 0.0) {
|
||||||
|
abCalcRaiseError(abCalcComplexResultError, SQRT_NAME);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
abCalcExprRealSet(&result, sqrt(expr->u.real));
|
abCalcExprRealSet(&result, sqrt(expr->u.real));
|
||||||
|
|
||||||
abCalcStackExprPop(NULL);
|
abCalcStackExprPop(NULL);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user