On 2013-02-27 12:47, FG wrote:
On 2013-02-26 15:10, bearophile wrote:
This third version is much simpler and it seems good enough for
Rosettacode:

http://codepad.org/YJjb1t91

Nice. Myself I'd add bits.reverse; after the N.iota.map..., because I'm more
used to a truth table where the left-most operands iterate the slowest.

or, without reverse, but perhaps not very clear:
N.iota.map!(j => !!(i & (1 << (N - j - 1)))).copy(bits[]);

Reply via email to