rithm 14.6.0

Arbitrary precision arithmetic.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
from hypothesis import given

from rithm.integer import Int
from tests.utils import equivalence

from . import strategies


@given(strategies.ints)
def test_basic(int_: Int) -> None:
    assert isinstance(int_.is_power_of_two(), bool)


@given(strategies.ints)
def test_equivalents(int_: Int) -> None:
    assert equivalence(
        int_.is_power_of_two(), int_ > 0 and not (int_ & (int_ - 1))
    )