Giter VIP home page Giter VIP logo

Comments (6)

ckrause avatar ckrause commented on August 22, 2024 1

I added native support for big numbers in LODA. No external libraries are used. There is an upper limit of the size (configurable at compile time). Currently we support up to 180 decimal digits. Still room for performance improvements:

2021-08-01 16:33:18|INFO |Starting operations benchmark
2021-08-01 16:33:18|INFO |mov: 0.079µs
2021-08-01 16:33:18|INFO |add: 0.159µs
2021-08-01 16:33:18|INFO |sub: 0.279µs
2021-08-01 16:33:18|INFO |trn: 0.392µs
2021-08-01 16:33:18|INFO |mul: 2.369µs
2021-08-01 16:33:18|INFO |div: 15.448µs
2021-08-01 16:33:18|INFO |dif: 19.218µs
2021-08-01 16:33:19|INFO |mod: 19.025µs
2021-08-01 16:33:19|INFO |pow: 89.842µs
2021-08-01 16:33:20|INFO |gcd: 583.418µs
2021-08-01 16:33:20|INFO |bin: 36.602µs
2021-08-01 16:33:20|INFO |cmp: 0.028µs
2021-08-01 16:33:20|INFO |min: 0.128µs
2021-08-01 16:33:20|INFO |max: 0.117µs

from loda.

karttu avatar karttu commented on August 22, 2024

There are several, for example GMP (GNU Multiple Precision Arithmetic Library), but I don't know about their current status. Note that with any bignum-implementation comes the added headache of the need to allocate and deallocate lists, possibly largish. (OTOH, with only two 64-bit words we already go up to 340282366920938463463374607431768211456, unsigned). But with well-designed interfaces that kind of change might be mostly transparent (coding-wise), except perhaps in the execution times and memory usage? But I'm not an expert in C++, so I don't know all of its perks.

from loda.

ckrause avatar ckrause commented on August 22, 2024

I don't think we don't need arbitrary precision. I was thinking to use C++ templates with std::arrays. That should be much more efficient, because everything is stored directly on the stack.

from loda.

jonmaiga avatar jonmaiga commented on August 22, 2024

I've had decent success with the trio mpir+mprf+mpreal. If you are aiming for integer only operations mpir might suffice (e.g. mpz_class) or possibly own implementation/other lightweight library.

(Great project btw!)

from loda.

neoneye avatar neoneye commented on August 22, 2024

For evaluating programs with bigger number you can use LODA Lab. However this cannot do mining of new programs.

PROMPT> loda eval A42 -t 19 
1,11,111,1111,11111,111111,1111111,11111111,111111111,1111111111,11111111111,111111111111,1111111111111,11111111111111,111111111111111,1111111111111111,11111111111111111,111111111111111111,1111111111111111111

PROMPT> loda-lab eval 42 -t 40
1,11,111,1111,11111,111111,1111111,11111111,111111111,1111111111,11111111111,111111111111,1111111111111,11111111111111,111111111111111,1111111111111111,11111111111111111,111111111111111111,1111111111111111111,11111111111111111111,111111111111111111111,1111111111111111111111,11111111111111111111111,111111111111111111111111,1111111111111111111111111,11111111111111111111111111,111111111111111111111111111,1111111111111111111111111111,11111111111111111111111111111,111111111111111111111111111111,1111111111111111111111111111111,11111111111111111111111111111111,111111111111111111111111111111111,1111111111111111111111111111111111,11111111111111111111111111111111111,111111111111111111111111111111111111,1111111111111111111111111111111111111,11111111111111111111111111111111111111,111111111111111111111111111111111111111,1111111111111111111111111111111111111111

(LODA is indeed a great project!)

from loda.

neoneye avatar neoneye commented on August 22, 2024

Awesome.

from loda.

Related Issues (20)

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.