Giter VIP home page Giter VIP logo

Comments (10)

asas2016SEC avatar asas2016SEC commented on July 16, 2024

on which file I have to work to solve this issue?

Give me the file name.

from bigint.

faheel avatar faheel commented on July 16, 2024

The file include/functions/random.hpp doesn't exist yet, you'll have to create it. The "template" would be similar to that of math.hpp (in include/functions/), so you can duplicate and modify math.hpp.

from bigint.

faheel avatar faheel commented on July 16, 2024

For reference, the following is the most appropriate way to generate true random numbers C++:

std::random_device rand_generator;
size_t rand_int = rand_generator();   // get a random number between 0 and UINT_MAX

Using this, one way to generate a random BigInt would be to keep appending randomly generated integers to BigInt.value:

rand_big.value += std::to_string(rand_int);

from bigint.

IbrarYunus avatar IbrarYunus commented on July 16, 2024

Hi, is this issue resolved yet?
As I wish to start contributing to open source projects (this is my first time doing opensource, so I may ask questions alot), and this seems a good point to start.
I will be using an editor in Windows 10 x64 to write code for this, is this okay?

from bigint.

faheel avatar faheel commented on July 16, 2024

@IbrarYunus I've been working on the second function and it's almost done.

You can take up #18 if you're interested in contributing.

from bigint.

FR4NKESTI3N avatar FR4NKESTI3N commented on July 16, 2024

Can I do the function to generate a random number within some range? Have never contributed to any project so i thought some simple function would be good start.

from bigint.

faheel avatar faheel commented on July 16, 2024

@FR4NKESTI3N Sure, you can give it a try.

from bigint.

FR4NKESTI3N avatar FR4NKESTI3N commented on July 16, 2024

Sorry, I was unable to work past 2 weeks. I have studied the results of existing big_random() on octave and they appear to be uniformly distributed. Wouldn't it be better to use this existing function with modulo? Something like:

result = low + big_random(x)%(high - low);

where x can be adjuted to reduce calculations.

There dosen't seem to be a need to write an entirely new function unless normal distribution is required.

Some nice graphics I got in octave

from bigint.

stkaufer avatar stkaufer commented on July 16, 2024

@faheel Check out branch GH-19-Random. Let me know if this meets the requirements for this issue and I'll create the Pull Request.

from bigint.

alihaider1264 avatar alihaider1264 commented on July 16, 2024

Is this task still an open issue? If so, I would like to contribute.

from bigint.

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.