Hacker News new | ask | show | jobs
by Someone 3418 days ago
That can be made shorter:

  x+=x*x+9;
Are you sure you don't mean

  x+=((x*x+9)>>32);
(and does that need the outer parentheses?) I doubt the first passes dieharder, as (if my C isn't too rusty) it alternates between odd and even numbers.
1 comments

I mean you assign the value of the expression to your result.

e.g:

    uint64_t x = 0;
    ...
    uint32_t y = (x+=x*x+9)>>32;