mirror of
https://github.com/jeremysrand/abCalc.git
synced 2025-02-17 05:30:29 +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;
|
||||
}
|
||||
|
||||
if (expr->u.real < 0.0) {
|
||||
abCalcRaiseError(abCalcComplexResultError, SQRT_NAME);
|
||||
return;
|
||||
}
|
||||
|
||||
abCalcExprRealSet(&result, sqrt(expr->u.real));
|
||||
|
||||
abCalcStackExprPop(NULL);
|
||||
|
Loading…
x
Reference in New Issue
Block a user