Skip to content

Instantly share code, notes, and snippets.

@jadsongmatos
Created November 13, 2021 18:27
Show Gist options
  • Save jadsongmatos/97397cee9e1d4c4227db2f62b96b63b2 to your computer and use it in GitHub Desktop.
Save jadsongmatos/97397cee9e1d4c4227db2f62b96b63b2 to your computer and use it in GitHub Desktop.
// 57.23 dec
r = ""
a = 0.23
b = 0;
for (let index = 0; index < 52; index++) {
b = a * 2
console.log(b)
if(b > 1){
a = b - 1;
r = r + "1"
} else {
a = b;
r = r + "0"
}
}
console.log(r)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment