16 Commits

Author SHA1 Message Date
Ankit Goel
dd06516d1c Deprecate delegating int() to __trunc__ 2024-09-17 16:06:09 +09:00
Daniel Chiquito
43d7c71a68 Fix integer rounding
The [docs](https://docs.python.org/3/library/functions.html#round)
specify that calling `round` with a negative precision removes
significant digits, so that `round(12345, -2) == 12300`. The
implementation was simply returning the original integer.

Additionally, `round(a, b)` is implemented as `(a / 10^b) * 10^b`, using
half-even rounding during the division.
2024-02-07 14:19:17 -05:00
Andrey Maltsev
d6350c672a Update test_long.py from Cpython v3.11.2 2023-04-06 00:39:09 +09:00
Devon Hollowood
82b4990224 Use improved log2() implementation for log10()
This also fixes a bug in the log2() implementation, where very large
negative integer arguments would not raise an exception (and instead
would turn into NaNs).
2022-10-24 18:46:49 -07:00
hrchu
8f0e40f2b2 Fix test_long::test_huge_rshift 2022-05-04 07:35:44 +09:00
Jeong YunWon
5222563063 Update test_long.py from CPython 3.10.2 2022-03-13 04:32:01 +09:00
snowapril
9bdf12230b Remove expected failure decorator on success test
Signed-off-by: snowapril <sinjihng@gmail.com>
2022-02-06 14:56:39 +09:00
Padraic Fanning
8083eed146 Skip panicking test 2021-09-03 20:25:06 -04:00
carbotaniuman
da9be2f7ef Fix clippy lint and unblock a test case 2020-11-11 15:48:22 -06:00
Yi Hyunjoon
f682a94132 Fix int shifts for zero 2020-09-05 17:41:26 +09:00
Jeong YunWon
6b71a89281 small int cache for int.__new__ 2020-08-08 15:17:22 +09:00
Jeong YunWon
aa899f6a1a convert skip to expectedFailure 2020-08-08 06:03:59 +09:00
Jeong YunWon
2a0e84828e Optimize int parsing based on bytes rather than str 2020-08-08 04:41:48 +09:00
Jeong YunWon
8e8efe0ec8 reform every TODO: RUSTPYTHON to same format 2020-06-17 18:47:13 +09:00
TheAnyKey
6bcd1da76b Skipping format test as it is inconclusive 2020-06-17 18:42:21 +09:00
CPython dev
09ef0b6b24 dedicated commit with test_long.py from CPython 3.10 (dev) 2020-06-17 18:42:12 +09:00