[libcxx-commits] [PATCH] D114129: [libc++] Fix `uniform_int_distribution` for 128-bit result type

Fabian Wolff via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Nov 25 16:40:45 PST 2021


fwolff updated this revision to Diff 389887.
fwolff added a comment.

This attempts to fix the remaining concerns/requests.

Regarding the other integer distributions: `binomial_distribution` and `negative_binomial_distribution` actually seem to work <https://godbolt.org/z/8v7jrMf7q>; `discrete_distribution` is not relevant here because nobody has over `UINT64_MAX` weights; and I haven't gotten `poisson_distribution` and `geometric_distribution` to work, but this might just be due to the extreme values of the parameters you'd have to use to get 128-bit results (and the latter just delegates to `negative_binomial_distribution` anyway).


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D114129/new/

https://reviews.llvm.org/D114129

Files:
  libcxx/include/__random/log2.h
  libcxx/include/__random/uniform_int_distribution.h
  libcxx/test/std/numerics/rand/rand.dis/rand.dist.uni/rand.dist.uni.int/int128.pass.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D114129.389887.patch
Type: text/x-patch
Size: 6471 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20211126/8a1cf1ed/attachment.bin>


More information about the libcxx-commits mailing list