| 1 | import math |
| 2 | |
| 3 | fn test_log_base() { |
| 4 | assert math.log(math.e) == 1.0 |
| 5 | } |
| 6 | |
| 7 | fn test_log2_base() { |
| 8 | assert math.log2(2.0) == 1.0 |
| 9 | } |
| 10 | |
| 11 | fn test_log10_base() { |
| 12 | assert math.log10(10.0) == 1.0 |
| 13 | assert math.log10(0.00000000000000001) == -17.0 |
| 14 | } |
| 15 | |
| 16 | fn test_log1p_base() { |
| 17 | assert math.log1p(math.e - 1) == 1.0 |
| 18 | } |
| 19 | |
| 20 | fn test_log_b_base() { |
| 21 | assert math.log_b(2.0) == 1.0 |
| 22 | } |
| 23 |