Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A helper to compare two numbers generously.
Python
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
.travis.yml
LICENSE
README
almost.py
almosttests.py
setup.py
tox.ini

README

Almost
~~~~~~

A helper to compare two numbers generously.

::

    from almost import almost
    
    def test_repeating_decimal():
        assert almost(1 / 3.) == 0.333
        assert almost(1 / 6.) == 0.167
        assert almost(3227 / 555., precision=6) == 5.814414

    def test_irrational_number():
        import math
        assert almost(math.pi) == 3.142
        assert almost(math.sqrt(2)) == 1.414
Something went wrong with that request. Please try again.