Last active
October 16, 2022 00:44
-
-
Save qntm/18f6c99e3f4b4f294af54463d0fbd161 to your computer and use it in GitHub Desktop.
Get in, loser, we're iterating over every 64-bit float
This file contains hidden or 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
const nextafter = require('nextafter') | |
for (let i = -Infinity; i !== Infinity; i = nextafter(i, Infinity)) { | |
console.log(i) | |
} | |
// Whoops, forgot a few the first time I ran this | |
console.log(Infinity) | |
console.log(NaN) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment