Skip to main content

This package contains implementation of the library "BigNumber".

Project description

BigNumber

BigNumber is an arbitrary precision number library which supports numbers with any values and many operations with them.

Installation

pip install BigNumber

Usage

To use this library, install it using the command shown in "Installation" section. Then, read the instructions below regarding how to use operations with BigNumber.

Addition

BigNumber can be added with any numbers using "+" operator.

Subtraction

BigNumber can be subtracted by any numbers using "-" operator.

Multiplication

BigNumber can be multiplied with any numbers using "*" operator.

Division

BigNumber can be divided by any numbers using "+" operator.

Modulo

The "%" sign can be used together with BigNumber for modulo operations.

Integer Division

The "//" sign can be used together with BigNumber for modulo operations.

Exponents

BigNumber can be raised to the power of any other numbers using "**" operator.

Conversion to int

int(BigNumber("5.3")) # 5

Conversion to float

float(BigNumber("5.3")) # 5.0

Conversion to mpf

to_mpf(BigNumber("5.0)) # 5.0

Trigonometric Functions

sin, cos, tan, cosec, sec, and cot are usable trigonometric functions. They are called using the code with the format {trigonometric function name}(a big number object). For example, sin(BigNumber("0.5")) to get the value of sin(0.5).

Hyperbolic Functions

sinh, cosh, tanh, cosech, sech, and coth are usable hyperbolic functions. They are called using the code with the format {hyperbolic function name}(a big number object). For example, sinh(BigNumber("0.5")) to get the value of sinh(0.5).

Factorial

The function factorial(big_num: BigNumber) will quickly get the factorial of any number.

Logarithms

The logarithm of any number using any base can be quickly achieved by using the function log_base(big_num: BigNumber, base: BigNumber or mpf or float or int) where big_num is a BigNumber object and base is the base used for the logarithm operation.

Square Root

sqrt(big_num: BigNumber) gets the square root of any number.

Cube Root

cbrt(big_num: BigNumber) gets the cube root of any number.

Square

BigNumber.squared() gets the value of a BigNumber squared.

Cube

BigNumber.cubed() gets the value of a BigNumber cubed.

Running Tests

The script "BigNumber_versus_mpf.py" (https://github.com/GlobalCreativeCommunityFounder/BigNumber/blob/main/BigNumber/BigNumber_versus_mpf.py) is used to run tests of the performance of BigNumber library against mpf library.

Sample Test Results

An example of test results for BigNumber versus mpf is in the file "BigNumber_versus_mpf.txt" (https://github.com/GlobalCreativeCommunityFounder/BigNumber/blob/main/BigNumber/BigNumber_versus_mpf.txt).

Project details


Release history Release notifications | RSS feed

This version

1

Download files

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

Source Distribution

BigNumber-1.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

BigNumber-1-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file BigNumber-1.tar.gz.

File metadata

  • Download URL: BigNumber-1.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.7

File hashes

Hashes for BigNumber-1.tar.gz
Algorithm Hash digest
SHA256 6102bce1260255dc15e44f53a8744375c1420987c89768ff6627b7a889ffab23
MD5 3e57eb1a04736a09ce63422d347e19a8
BLAKE2b-256 8ab7c5d1ca79cbeaac1b49ccd7b863f251045c7df33cf83c3902f7cbc8f3bb33

See more details on using hashes here.

File details

Details for the file BigNumber-1-py3-none-any.whl.

File metadata

  • Download URL: BigNumber-1-py3-none-any.whl
  • Upload date:
  • Size: 5.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.7

File hashes

Hashes for BigNumber-1-py3-none-any.whl
Algorithm Hash digest
SHA256 33c016cda0f8189e1e115504b5d7c952cf3b8e13449614bef5c5aa7a60ca6b60
MD5 231bb633664443cd52b8ea31dbb99a7f
BLAKE2b-256 a267605712b4650a4a295cbc2ca0aa697973a0bc30a40f28372e76934895e394

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