[Issue 5271] New: Not constant RAND_MAX
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Nov 24 11:43:30 PST 2010
http://d.puremagic.com/issues/show_bug.cgi?id=5271
Summary: Not constant RAND_MAX
Product: D
Version: D2
Platform: x86
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P2
Component: Phobos
AssignedTo: nobody at puremagic.com
ReportedBy: bearophile_hugs at eml.cc
--- Comment #0 from bearophile_hugs at eml.cc 2010-11-24 11:42:07 PST ---
I think the std.c.stdlib.RAND_MAX (core.stdc.stdlib.RAND_MAX) value is
hardcoded in Phobos, in a line of the two "stdlib.d" files:
enum RAND_MAX = 32767;
If this is true, then it's an error, because in other systems rand() may return
other values. In particular, on an Ubuntu Linux I have seen RAND_MAX needs to
be int.max instead of short.max. So this value has to change according to the
situation.
--
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