Fixed 0^y for y > 0

While 0^0 == 1, now for y > 0, 0^y == 0.

Adjusted cal/test8900.cal to reflect the this bug fix.

Added tests to cal/regress.cal to help verify bug fix is fixed.
This commit is contained in:
Landon Curt Noll
2022-04-07 23:54:06 -07:00
parent e9eef2dfa2
commit 56b6613da8
3 changed files with 29 additions and 6 deletions

View File

@@ -2058,11 +2058,17 @@ define t010()
return 5;
}
/*
* Once, when an expression such as 0^(6-6) returned 0,
* When an expression such as 0^(6-6) returned 0,
* then stirling2(10, 5) == 42525. However when we made9
* 0^(6-6) == 0^0 == 1, then stirling2(10, 5) == 5102999/120.
* 0^(6-6) == 0^0 == 1, then stirling2(10, 5) == 5102999/120
* as in:
*
* if ((stirling2(10, 5) - (5102999/120)) != 0) {
* epsilon(eps);
* return 6;
* }
*/
if ((stirling2(10, 5) - (5102999/120)) != 0) {
if ((stirling2(10, 5) - 42525) != 0) {
epsilon(eps);
return 6;
}