-
-
Save collin/feca30eb9064db605146ef7bba9ad80f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.clear() | |
require('console.table') | |
const lpad = require('lpad') | |
const nums = [] | |
const min = 0 | |
const max = 20 | |
const step = 1 | |
for (let i=max;i > min; i-=step) { | |
nums.push(i) | |
} | |
console.table(nums.map( n => { | |
return { | |
n, | |
//'binary': n.toString(2), | |
//'14': (14).toString(2), | |
//'& 14': (n & 14).toString(2), | |
//'| 14': (n | 14).toString(2), | |
//'^ 14': (n ^ 14).toString(2), | |
//'~ 4': (~n).toString(2), | |
'>> 1 (int)': n >> 1, | |
'>> 1': (n >> 1).toString(2), | |
//'mod 3': n % 3, | |
//'mod 5': n % 5, | |
} | |
})) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment