Пример #1
0
def test_long_num():
    assert scinot.format(341283875012.238, 4) == "3.413 × 10¹¹"
Пример #2
0
def test_0_sigfigs():
    # disply scinot with standard number and 0 as digits count

    with pytest.raises(ValueError):
        scinot.format(1234567890, 0)
Пример #3
0
def test_neg_num():
    assert scinot.format(-8328389, 1) == "-8 × 10⁶"
Пример #4
0
def test_lower_sigfigs():
    assert scinot.format(.0000098326543, 3) == "9.83 × 10⁻⁶"
Пример #5
0
def test_tiny_num():
    assert scinot.format(.0000098326543, 6) == "9.83265 × 10⁻⁶"
Пример #6
0
def test_short_num():
    assert scinot.format(15, 4) == "1.5 × 10"