-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: Reintroduce random BigFloats removed in 1a8885b #13950
Conversation
8c2cff5
to
1570264
Compare
Feedback welcome |
Implementation looks okay to me, but does need tests and docs. |
Thanks. As said, if there is general interests, I add the tests and the docs. |
Naive question (I don't know how mpfr works) : are there too many subtleties to avoid manipulating directly the |
What @rfourquet is suggesting seems plausible to me – the MPFR data structure is well-defined and not terribly complicated and we have access to it on the Julia side as well. |
Triage: I admit I won't implement the direct direct MPFR float construction in the next future, but I can add tests and docs for this approach. If somebody wants to take on @rfourquet s proposal I assist of course. |
Given the lack of activity here I don't think this should hold up the 0.5 release. It's a new (reintroduced) feature so it'll happen when it happens. |
Closing this (dormant) PR, the corresponding issue is open for reference. |
The work you did here is worth keeping somewhere in my opinion, either in base or a package (e.g. https://github.com/sunoru/RandomNumbers.jl/ if the author welcomes contributions). My preference is for base, but I guess unlikely to happen, as non-essential (and base may eventually not depend on GMP anymore). I would happily assist extending your code to make it into a full fledged RNG. |
These would be the bare bones changes needed to reintroduce sampling of random floats to address #13948 (Tests and docs if interest, then.)
This does not yet intent to link the
BigFloat
-number generator with the global number generator. This can be done similar to #4845, but I think linking those is not strictly necessary.This order of dependencies (
GMPRandState
in gmp.jl,mpfr_urandomb
-wrapper in mpfr.jl depending onGMPRandState
and finallyBigFloatRNG
in random.jl depending on both of them) corresponds with the order in sysimg.jl. Would that mean that the problem 1a8885b does not appear?