News for hackers. Stuff that matters.
Re:FizzBuzz in Too Much Detail by contravariant on Sunday April 26, 2015 @12:53PM (#9442348)
That's not really an optimal way to check divisibility though, if you want to be quick try:

    fizz = (uint)i*2863311531 <= (uint)i;
    buzz = (uint)i*3435973837 <= (uint)i;
Should work for fine for i<=1000.

Edit: changed "<" to "<=", otherwise it fails when i=0.

Re:FizzBuzz in Too Much Detail by kazagistar on Sunday April 26, 2015 @01:04PM (#9442401)
He mentions ruby uses bigintegers, while this assumes something else, right?
Re:FizzBuzz in Too Much Detail by contravariant on Sunday April 26, 2015 @02:30PM (#9442747)
The above assumes unsigned 32bit integers. It abuses integer overflow. Perhaps I should have stated that more explicitly.