mirror of
https://github.com/lcn2/calc.git
synced 2025-08-16 01:03:29 +03:00
Fixed 0^(0) and 0^(6-6) to return 1
Calc as defined 0^0 as 1. However in the past, 0 raised to an expression that evaluted to zero returned 1. The result was that 0^0 was different than 0^(6-6) or even 0^(0). Now, calc will return 1 for 0^(0) and 0^zero when zero == 0.
This commit is contained in:
@@ -2057,7 +2057,12 @@ define t010()
|
||||
epsilon(eps);
|
||||
return 5;
|
||||
}
|
||||
if ((stirling2(10, 5) - (42525)) != 0) {
|
||||
/*
|
||||
* Once, 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.
|
||||
*/
|
||||
if ((stirling2(10, 5) - (5102999/120)) != 0) {
|
||||
epsilon(eps);
|
||||
return 6;
|
||||
}
|
||||
|
Reference in New Issue
Block a user