Skip to content

Instantly share code, notes, and snippets.

@rankun203
Created August 31, 2016 16:50
Show Gist options
  • Save rankun203/bd602d031fa2febbee9d917ee9f66311 to your computer and use it in GitHub Desktop.
Save rankun203/bd602d031fa2febbee9d917ee9f66311 to your computer and use it in GitHub Desktop.
Calc message bubble width with a log2 function
var x = 30;
var width = 1 - 1 / Math.log2(x + 1);
console.log(width);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment