Skip to main content

A Python package for Pi calculations.

Project description

Pi Library

pilibr is a simple Python package for performing calculations with π (Pi).
It provides a symbolic Pi class as well as functions for approximating Pi using different methods.

Installation

You can install the package via pip/npm:

pip install pilibr
npm install pilibr

Or install locally for development:

Currently not supported. Please check back in version 0.0.2.

Usage

Using the Pi class

from pilibr import Pi

# Create Pi objects
pi_default = Pi()       # 1 * π / 1
pi_half = Pi(1, 2)      # 1 * π / 2

# Symbolic representation
print(pi_default)       # 1 * π / 1

# Numerical approximation
print(pi_default.evall(10000))   # Leibniz method
print(pi_default.evaln(5000))    # Nilakantha method

Using the helper function pif

from pilibr import pif

# Approximate Pi using the Leibniz series
print(pif(method="leibniz", iterations=10000))

# Approximate Pi using the Nilakantha series
print(pif(method="nilakantha", iterations=5000))

Features

  • Symbolic Pi representation

  • Approximation using:

    • Leibniz series
    • Nilakantha series
  • Easy-to-use helper function pif

License

This project is licensed under the Apache-2.0 License.

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

pilibr-0.0.1.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pilibr-0.0.1-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file pilibr-0.0.1.tar.gz.

File metadata

  • Download URL: pilibr-0.0.1.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for pilibr-0.0.1.tar.gz
Algorithm Hash digest
SHA256 24c1f3dc3582aa19ee23d240dc09fcd73a21bb06955a15567c9eadc4bf3803f6
MD5 38ef5b7437f690a36f469a05176e15db
BLAKE2b-256 e9bd0e02aa1cfa1095d391ead8f4d4dd23e7b05ae93b8ac88b0e93edc88e2149

See more details on using hashes here.

File details

Details for the file pilibr-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: pilibr-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 6.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for pilibr-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f5ed3114f6a2fab502bacff68601a3e17a442fa4f0ca07ff500fb210fb3af844
MD5 3c73b803aa8e818c77c7f3148f7dec24
BLAKE2b-256 0c0304046783d97acecf76a7d6d2ce72e36ac386ec4ba396cd4ba5e5c487ba93

See more details on using hashes here.

Supported by

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