[Issue 3785] New: std.random.uniform(bound, uint, uint)(uint.min, uint.max) fails.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Feb 8 23:56:21 PST 2010


http://d.puremagic.com/issues/show_bug.cgi?id=3785

           Summary: std.random.uniform(bound,uint,uint)(uint.min,uint.max)
                    fails.
           Product: D
           Version: 2.039
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody at puremagic.com
        ReportedBy: shro8822 at vandals.uidaho.edu


--- Comment #0 from BCS <shro8822 at vandals.uidaho.edu> 2010-02-08 23:56:21 PST ---
The generic uniform random number generator fails for the "any uint" case by
throwing a FP exception. moving either bound in by one fixes the problem.

Also, I think there should be a convenience function for that case:

T uniform(T)(){ return uniform!("[]",T,T)(T.min,T.max); }

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list