Created
August 15, 2016 19:02
-
-
Save axic/d8ec3abfc91fef9298638f7e0f8cc730 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
// (words * 3 + words ^ 2 / 512) - (allocated_words * 3 + allocated_words ^ 2 / 512) | |
var memsize = 1 | |
var current = 0 | |
while (true) { | |
var a = (memsize * 3) + (memsize ^ 2 / 512) | |
var b = ((memsize - 1) * 3) + ((memsize - 1) ^ 2 / 512) | |
current += (a - b) | |
memsize++ | |
if (current > 4500000) | |
break | |
} | |
console.log(memsize, memsize * 32, current) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment