Skip to main content

A helper to compare two numbers generously

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

almost-0.1.dev.tar.gz (2.2 kB view details)

Uploaded Source

File details

Details for the file almost-0.1.dev.tar.gz.

File metadata

  • Download URL: almost-0.1.dev.tar.gz
  • Upload date:
  • Size: 2.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for almost-0.1.dev.tar.gz
Algorithm Hash digest
SHA256 b27e802c6fcb038f6fa73df59c3ea9235100dc087e5ccabc62f56b730e606103
MD5 0856f5bf775d9c720a0d15d7db3d6f82
BLAKE2b-256 0995677f9011c3909ca4da30206b7974f788fd595aee07f7317523632e23b023

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page