mirror of
https://github.com/lcn2/calc.git
synced 2025-08-16 01:03:29 +03:00
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:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user