Skip to content

Conversation

@MkeyBeez
Copy link

Implements addition, subtraction, multipilcation, division, and modulo operations.

We cast everything to a struct BigFloat to unify common operations needed for string arithmetic.
Multiplication for numbers longer than 32 digits uses recursive karatsuba, one can of couse tune the amount of digits to specify exactly when this kicks in; I have not done extensive benchmarks yet.

The easiest way to try out the proposed implementation is to open the attached colab.ipynb in a google colab instance and execute the notebook. You can then try the operations interactively.

Implementation of Square roots should be easy with an iterative algorithm, Implementing string exponentiation is a bit more tricky since this requires logarithm operations in non integer cases. Let me know what you think.

@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
50 Security Hotspots
E Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant