[libcxx] [PATCH] http://llvm.org/bugs/show_bug.cgi?id=18767

Howard Hinnant hhinnant at apple.com
Tue Feb 11 12:34:03 PST 2014


http://llvm.org/bugs/show_bug.cgi?id=18767

This is a fix & test for this bug in uniform_real_distribution.  I believe the bug is simply due to roundoff error, and the way to fix it is to iterate until the roundoff does not happen.


In the test case, which is an extreme, there are about 2.6 iterations / call.  In a more realistic scenario, such as defaulting the range to [0, 1), there is only 1 iteration / call (as before this fix).

Howard
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PR18767.patch
Type: application/octet-stream
Size: 1663 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140211/a785d3fc/attachment.obj>


More information about the cfe-commits mailing list