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


Brad Roberts <bra...@puremagic.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|repeate...@gmail.com        |nob...@puremagic.com


--- Comment #2 from Brad Roberts <bra...@puremagic.com> 2011-03-27 15:23:47 PDT 
---
Reduced bug, nothing to do with the random parts at all:

module bug;

extern(C) int printf(const char*, ...);

int main()
{
    // neither of these produce the expected result.
    ulong[] checking = [ 2_463_534_242UL ];
    //long[] checking = [ 2_463_534_242L ];

    printf("typeof(checking) = '%.*s'\n",
        typeid(checking).toString.length,
        typeid(checking).toString.ptr);

    foreach (i, e; checking)
        printf("i = %zd, e = %lld\n", i, e);

    return 0;
}

$ dmd -m64 bug-random.d && ./bug-random

Produces:
  typeof(checking) = 'ulong[]'
  i = 0, e = -1831433054

using %llu (or %lu, just to make sure I wasn't crazy about the size specifier):
  typeof(checking) = 'ulong[]'
  i = 0, e = 18446744071878118562

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

Reply via email to