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

            Bug ID: 20843
           Summary: binomial_distribution<unsigned> is broken.
           Product: libc++
           Version: 3.4
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]
    Classification: Unclassified

The binomial_distribution class from <random> must allow any of the following
types as result_type, required by the c++ standard: short, int, long, long
long, unsigned short, unsigned int, unsigned long, or unsigned long long.
However, when binomial_distribution<unsigned> is used, it will often return
values outside of its supposed range, which are in fact -2 casted to the
unsigned type.

Note that using unsigned types with binomial_distribution makes sense, because
its result must never be negative.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to