Skip to main content

No project description provided

Project description

calc-rs

a calculator module for Python and Rust capable of computing arbitrarily long equations and functions.

Speed Test

These tests were done using hyperfine and the speed-test.sh script in the test folder

testing python version:
Benchmark 1:  python -c "import calculator as calc; calc.solve_func(\"f(x)= 4+3x+x**2+x**3\", -1000, 1000)"
  Time (mean ± σ):      1.150 s ±  0.018 s    [User: 1.130 s, System: 0.016 s]
  Range (min … max):    1.126 s …  1.231 s    50 runs


testing rust version:
Benchmark 1:  python -c "import calculators as calc; calc.solve_func(\"f(x)= 4+3x+x^2+x^3\", -1000, 1000)"
  Time (mean ± σ):      11.8 ms ±   0.8 ms    [User: 10.6 ms, System: 3.6 ms]
  Range (min … max):    11.1 ms …  14.5 ms    25 runs

As you can see the rust version is significantly faster.

Usage

there are three functions that this libray exposes:

Function Args Description
solve equasions: list(str) takes a list of equations as strings and solves eatch one returning a list of answers.
solve_func f: str, start: int, stop: int solves the function, f, at all integer points between start and stop.
solve_funcs fs: list(str), start: int, stop: int solves a list of functions, fs, for all integer points between start and stop. returns a dictionary whose keys are function names and whose values are a tuple of a list of x values and a list of y values.

Installation

with pip:

pip install calc-rs

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

calc_rs-0.2.0.tar.gz (16.2 kB view hashes)

Uploaded Source

Built Distributions

calc_rs-0.2.0-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.9 MB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

calc_rs-0.2.0-pp310-pypy310_pp73-manylinux_2_17_s390x.manylinux2014_s390x.whl (2.1 MB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ s390x

calc_rs-0.2.0-pp310-pypy310_pp73-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (2.1 MB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ ppc64le

calc_rs-0.2.0-pp310-pypy310_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (1.9 MB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ ARMv7l

calc_rs-0.2.0-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.9 MB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ ARM64

calc_rs-0.2.0-pp310-pypy310_pp73-manylinux_2_12_i686.manylinux2010_i686.whl (2.0 MB view hashes)

Uploaded PyPy manylinux: glibc 2.12+ i686

calc_rs-0.2.0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.9 MB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

calc_rs-0.2.0-pp39-pypy39_pp73-manylinux_2_17_s390x.manylinux2014_s390x.whl (2.1 MB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ s390x

calc_rs-0.2.0-pp39-pypy39_pp73-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (2.1 MB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ ppc64le

calc_rs-0.2.0-pp39-pypy39_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (1.9 MB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ ARMv7l

calc_rs-0.2.0-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.9 MB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ ARM64

calc_rs-0.2.0-pp39-pypy39_pp73-manylinux_2_12_i686.manylinux2010_i686.whl (2.0 MB view hashes)

Uploaded PyPy manylinux: glibc 2.12+ i686

calc_rs-0.2.0-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.9 MB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

calc_rs-0.2.0-pp38-pypy38_pp73-manylinux_2_17_s390x.manylinux2014_s390x.whl (2.1 MB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ s390x

calc_rs-0.2.0-pp38-pypy38_pp73-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (2.1 MB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ ppc64le

calc_rs-0.2.0-pp38-pypy38_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (1.9 MB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ ARMv7l

calc_rs-0.2.0-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.9 MB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ ARM64

calc_rs-0.2.0-pp38-pypy38_pp73-manylinux_2_12_i686.manylinux2010_i686.whl (2.0 MB view hashes)

Uploaded PyPy manylinux: glibc 2.12+ i686

calc_rs-0.2.0-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.9 MB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

calc_rs-0.2.0-pp37-pypy37_pp73-manylinux_2_17_s390x.manylinux2014_s390x.whl (2.1 MB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ s390x

calc_rs-0.2.0-pp37-pypy37_pp73-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (2.1 MB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ ppc64le

calc_rs-0.2.0-pp37-pypy37_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (1.9 MB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ ARMv7l

calc_rs-0.2.0-pp37-pypy37_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.9 MB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ ARM64

calc_rs-0.2.0-pp37-pypy37_pp73-manylinux_2_12_i686.manylinux2010_i686.whl (2.0 MB view hashes)

Uploaded PyPy manylinux: glibc 2.12+ i686

calc_rs-0.2.0-cp312-none-win_amd64.whl (863.7 kB view hashes)

Uploaded CPython 3.12 Windows x86-64

calc_rs-0.2.0-cp312-none-win32.whl (794.6 kB view hashes)

Uploaded CPython 3.12 Windows x86

calc_rs-0.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.9 MB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

calc_rs-0.2.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl (2.1 MB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ s390x

calc_rs-0.2.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (2.1 MB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ ppc64le

calc_rs-0.2.0-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (1.9 MB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ ARMv7l

calc_rs-0.2.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.9 MB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ ARM64

calc_rs-0.2.0-cp312-cp312-manylinux_2_12_i686.manylinux2010_i686.whl (2.0 MB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.12+ i686

calc_rs-0.2.0-cp312-cp312-macosx_11_0_arm64.whl (996.9 kB view hashes)

Uploaded CPython 3.12 macOS 11.0+ ARM64

calc_rs-0.2.0-cp312-cp312-macosx_10_12_x86_64.whl (1.0 MB view hashes)

Uploaded CPython 3.12 macOS 10.12+ x86-64

calc_rs-0.2.0-cp311-none-win_amd64.whl (863.8 kB view hashes)

Uploaded CPython 3.11 Windows x86-64

calc_rs-0.2.0-cp311-none-win32.whl (794.8 kB view hashes)

Uploaded CPython 3.11 Windows x86

calc_rs-0.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.9 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

calc_rs-0.2.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl (2.1 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ s390x

calc_rs-0.2.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (2.1 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ ppc64le

calc_rs-0.2.0-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (1.9 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ ARMv7l

calc_rs-0.2.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.9 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ ARM64

calc_rs-0.2.0-cp311-cp311-manylinux_2_12_i686.manylinux2010_i686.whl (2.0 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.12+ i686

calc_rs-0.2.0-cp311-cp311-macosx_11_0_arm64.whl (997.2 kB view hashes)

Uploaded CPython 3.11 macOS 11.0+ ARM64

calc_rs-0.2.0-cp311-cp311-macosx_10_12_x86_64.whl (1.0 MB view hashes)

Uploaded CPython 3.11 macOS 10.12+ x86-64

calc_rs-0.2.0-cp310-none-win_amd64.whl (863.8 kB view hashes)

Uploaded CPython 3.10 Windows x86-64

calc_rs-0.2.0-cp310-none-win32.whl (794.8 kB view hashes)

Uploaded CPython 3.10 Windows x86

calc_rs-0.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.9 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

calc_rs-0.2.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl (2.1 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ s390x

calc_rs-0.2.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (2.1 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ ppc64le

calc_rs-0.2.0-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (1.9 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ ARMv7l

calc_rs-0.2.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.9 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ ARM64

calc_rs-0.2.0-cp310-cp310-manylinux_2_12_i686.manylinux2010_i686.whl (2.0 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.12+ i686

calc_rs-0.2.0-cp310-cp310-macosx_11_0_arm64.whl (997.2 kB view hashes)

Uploaded CPython 3.10 macOS 11.0+ ARM64

calc_rs-0.2.0-cp310-cp310-macosx_10_12_x86_64.whl (1.0 MB view hashes)

Uploaded CPython 3.10 macOS 10.12+ x86-64

calc_rs-0.2.0-cp39-none-win_amd64.whl (863.7 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

calc_rs-0.2.0-cp39-none-win32.whl (794.8 kB view hashes)

Uploaded CPython 3.9 Windows x86

calc_rs-0.2.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.9 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

calc_rs-0.2.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl (2.1 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ s390x

calc_rs-0.2.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (2.1 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ ppc64le

calc_rs-0.2.0-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (1.9 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ ARMv7l

calc_rs-0.2.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.9 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ ARM64

calc_rs-0.2.0-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.whl (2.0 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.12+ i686

calc_rs-0.2.0-cp38-none-win_amd64.whl (863.7 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

calc_rs-0.2.0-cp38-none-win32.whl (794.7 kB view hashes)

Uploaded CPython 3.8 Windows x86

calc_rs-0.2.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.9 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

calc_rs-0.2.0-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl (2.1 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ s390x

calc_rs-0.2.0-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (2.1 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ ppc64le

calc_rs-0.2.0-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (1.9 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ ARMv7l

calc_rs-0.2.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.9 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ ARM64

calc_rs-0.2.0-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.whl (2.0 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.12+ i686

calc_rs-0.2.0-cp37-none-win_amd64.whl (863.9 kB view hashes)

Uploaded CPython 3.7 Windows x86-64

calc_rs-0.2.0-cp37-none-win32.whl (794.7 kB view hashes)

Uploaded CPython 3.7 Windows x86

calc_rs-0.2.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.9 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64

calc_rs-0.2.0-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl (2.1 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ s390x

calc_rs-0.2.0-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (2.1 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ ppc64le

calc_rs-0.2.0-cp37-cp37m-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (1.9 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ ARMv7l

calc_rs-0.2.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.9 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ ARM64

calc_rs-0.2.0-cp37-cp37m-manylinux_2_12_i686.manylinux2010_i686.whl (2.0 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.12+ i686

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