GithubHelp home page GithubHelp logo

Multiplication Algorithms about uint128_t HOT 6 OPEN

calccrypto avatar calccrypto commented on August 16, 2024
Multiplication Algorithms

from uint128_t.

Comments (6)

armchaircaver avatar armchaircaver commented on August 16, 2024

Surely Jason's code implements this via the operator overload starting in line 208 of uint128_t.cpp :
uint128_t uint128_t::operator*(const uint128_t & rhs) const{
...

By the way, you may be interested in the modified version of this operator overload that I wrote to solve a contest center puzzle, described in http://arthurvause.blogspot.co.uk/2017/05/three-pandigitals.html

from uint128_t.

calccrypto avatar calccrypto commented on August 16, 2024

I do long multiplication in uint128_t and uint256_t because these two types have fixed numbers of internal digits, and thus multiplication can be done in constant time. I have implemented long multiplication in integer, but it is relatively slow, when compared to other algorithms, which is why I have a list of commented out multiplication methods that are implemented but not used.

from uint128_t.

Kronuz avatar Kronuz commented on August 16, 2024

For modulo and divisions, have you tried Barrett? There’s also other method which combines Newton Inversion with Barrett’s algorithm (Newton Division), there’s an interesting paper here comparing algorithms: http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.111.9736&rep=rep1&type=pdf

from uint128_t.

calccrypto avatar calccrypto commented on August 16, 2024

Cool! Thanks! I'll get to it at some point.

from uint128_t.

Kronuz avatar Kronuz commented on August 16, 2024

I made a ton of additions/changes in https://github.com/Kronuz/uint_t lots of optimizations and quite a few algorithms

from uint128_t.

calccrypto avatar calccrypto commented on August 16, 2024

Nice!

from uint128_t.

Related Issues (14)

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.