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



--- Comment #5 from Walter Bright <bugzi...@digitalmars.com> 2011-08-09 
17:34:51 PDT ---
(In reply to comment #4)
> As reference, DMD 2.055head compiles this D2 function:
> T rot(T)(T x, int shift) {
>     return (x >> shift) | (x << (T.sizeof * 8 - shift));
> }

The mistake is this is not a correct rotate function. (x >> shift) is a signed
right shift. Rewrite as (x >>> shift).

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

Reply via email to