Comments (10)
on which file I have to work to solve this issue?
Give me the file name.
from bigint.
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.
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.
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.
@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.
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.
@FR4NKESTI3N Sure, you can give it a try.
from bigint.
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.
from bigint.
@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.
Is this task still an open issue? If so, I would like to contribute.
from bigint.
Related Issues (20)
- Build fails in CLion 2017.3 HOT 1
- Add support for hexadecimal string in constructor HOT 9
- Should is_valid_number be able to handle negative numbers? HOT 2
- big_random might return a BigInt having a value with a leading 0 HOT 4
- Hex support HOT 1
- `big_random` function: mistake in description and better implementation suggestion HOT 3
- Improve README
- sqrt() always returns 1 HOT 4
- Improve the documentation related to development
- Support bitwise operation HOT 12
- a bug in DIV HOT 1
- MacOS Invalid token in expression during Make HOT 1
- Cannot compile on msvc2019, cmake, when trying to compile the release 0.50 HOT 1
- Very slow compared to the GNU MP Bignum Library HOT 3
- BigInt problem with hexdigit string HOT 1
- `log()` support
- Elaborate instructions on which files to #include for which functions/operators HOT 2
- Fix for MSVC?
- Invalid string access on modulo
- Some BigInt relational operators are not optimal
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bigint.