GithubHelp home page GithubHelp logo

ryanmcalpine / cs415_project_02 Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 3.89 MB

Multiplication and exponentiation using Karatsuba Method

Python 99.71% PowerShell 0.27% Batchfile 0.02%
nicholas-keng ryan-mcalpine python python3 karatsuba karatsuba-multiplication karatsuba-algorithm multiplication exponentiation divide-and-conquer

cs415_project_02's Introduction

CS415_Project_02

By Nicholas Keng and Ryan McAlpine

About:

This python program makes use of Karatsuba multiplication to either multiply or exponentiate two values A and B (<=1000) after initially converting them into lists of single digits.

Instructions:

When executing the program, enter 1 for multiplication, enter 2 for exponentiation, or enter 3 to quit.

For task 1, the expected output is the accurate result of inputs A and B multiplied (A*B).

For task 2, the expected output is the accurate result of raising input A to the power of B (A^B).

Known Issues:

If the function subtract_arrays(A, B) is given parameters such that A < B, its return value will be incorrect. In other words, the function as it is written is incapable of handling negative values. This does not seem to cause any problems when it is called by karatsuba_mult(), however, so we have left it as is for now.

cs415_project_02's People

Contributors

ryanmcalpine avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.