Skip to main content

For all your adding needs, up to numbers of 250.

Project description

plus

For all your adding needs, up to numbers of about 250 because otherwise the maximum recursion depth is exceeded.

FAQ

What is plus?

Plus was made to redefine the '+'operator in a recursive way, without using the '+'-operator itself.

Why?

This library was inspired by the enormous amount of isEven and isOdd-type memes, including one where '+' was defined by hardcoding every possible combination of the first 100-or-so numbers.

It was not made with the intention of being used (obv.), but rather to see how ridiculous I could make this.

The last 5 lines (while-loop & bitshift) by themselves are actually enough to add two numbers together (and it doesn't exceed the maximum recursion depth instantly), which was also done for this very reason. That part being in there adds to the overall idea.

Why is there a cache?

Well you see, when using numbers above 10 it started to get a bit slow. Calculating plus(50, 20) had been running for half an hour, and wasn't showing any signs of stopping any time soon.

This meant I had to introduce dynamic programming to speed it up a bit, and store results of calculations that had been made before.

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

pluspy-0.0.2.tar.gz (2.5 kB view details)

Uploaded Source

Built Distribution

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

pluspy-0.0.2-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

Details for the file pluspy-0.0.2.tar.gz.

File metadata

  • Download URL: pluspy-0.0.2.tar.gz
  • Upload date:
  • Size: 2.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.0.post20201221 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.6.9

File hashes

Hashes for pluspy-0.0.2.tar.gz
Algorithm Hash digest
SHA256 0916d64cc7ae276b7ac50e10ffb3eff7004b001cd358599ac613f7b046b72810
MD5 9823ab34bc13570986e17b6e9b229c7f
BLAKE2b-256 b690a88ced3e23ba12060601fb02d3d428cf9dbea585c0da7ab803d0c8176dce

See more details on using hashes here.

File details

Details for the file pluspy-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: pluspy-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 3.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.0.post20201221 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.6.9

File hashes

Hashes for pluspy-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 bb1918fb6359480edb2dc2fd4b94e3f973b4ec4c0bd7728721e4debee38232b8
MD5 68e46076eaa77d28b8653de936b69f86
BLAKE2b-256 f9b458506864e5687d8e3d967e8a46e7b372291023026c61bd382698a30e4b71

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