Python/divide_and_conquer
lighting9999 78adb6463f
Fix And Add power.py
To fix the inaccuracies and allow handling of negative exponents and bases, the key issue lies in how negative numbers are handled in the power calculation, especially when dividing.
## Example Output:
```python
>>> power(4, 6)
4096
>>> power(2, 3)
8
>>> power(-2, 3)
-8
>>> power(2, -3)
0.125
>>> power(-2, -3)
-0.125
```
2025-02-08 17:48:46 +08:00
..
2024-08-25 17:33:11 +02:00
2020-09-29 12:39:07 +02:00
2021-09-07 13:37:03 +02:00
2025-02-08 17:48:46 +08:00