[Issue 11758] std.random.uniform fails when mixing signed/unsigned integrals

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Feb 23 09:41:55 PST 2014


https://d.puremagic.com/issues/show_bug.cgi?id=11758


Peter Alexander <peter.alexander.au at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |peter.alexander.au at gmail.co
                   |                            |m


--- Comment #1 from Peter Alexander <peter.alexander.au at gmail.com> 2014-02-23 09:41:44 PST ---
I think 3 is the correct solution.

You are right in saying that it disallows legitimate use cases such as
"uniform(-2, 5u)", but currently these don't work, so we don't break any code.

You are also right in saying that it incurs a small performance hit but (a) it
is negligible compared to the generation of a random number, and (b) the user
can easily fix it by not using mixed signed/unsigned.

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


More information about the Digitalmars-d-bugs mailing list