Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/Python/Sympy/sympy/external/tests/     Datei vom 6.10.2026 mit Größe 432 B image not shown  

Quelle  test_gmpy.py   Sprache: Python

 

from __future__ import annotations
from sympy.external.gmpy import LONG_MAX, iroot
from sympy.testing.pytest import raises


def test_iroot():
    assert iroot(2, LONG_MAX) == (1, False)
    assert iroot(2, LONG_MAX + 1) == (1, False)
    for x in range(3):
        assert iroot(x, 1) == (x, True)
    raises(ValueError, lambda: iroot(-1, 1))
    raises(ValueError, lambda: iroot(0, 0))
    raises(ValueError, lambda: iroot(0, -1))

Messung
CHZG
819710092

¤ Dauer der Verarbeitung: 0.3 Sekunden  ¤

*© Formatika GbR, Deutschland