in reply to Re^2: C code translation to Perl
in thread C code translation to Perl

I have no clue why the values differs from the 5th element on.

You are using a 64-bit perl, (or possibly a 32-bit Perl with 64-bit IVs enabled), which means that your attempts to reproduce the results from the C code which uses 32-bit integers isn't working.

The type of bit-wise math in the C code relies heavily on the implicit mod 2**32 of intermediate results to work.

For a way to 'fix' it, see Re: emulate 32-bit on perl 64.


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

The start of some sanity?

Replies are listed 'Best First'.
Re^4: C code translation to Perl
by bottch (Initiate) on Jan 31, 2012 at 16:18 UTC
    Thanks a lot BrowserUK! You just kinda hit the bullseye :) Now everything works fine. Thanks again. regards,bottch