Skip to content

Instantly share code, notes, and snippets.

@code-for-coffee
Last active November 3, 2016 02:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save code-for-coffee/b8b95ba78579e380db1bb757f3440ced to your computer and use it in GitHub Desktop.
Save code-for-coffee/b8b95ba78579e380db1bb757f3440ced to your computer and use it in GitHub Desktop.
massTest
const json = require('./data.json');
const MAX_INT = Number.MAX_SAFE_INTEGER;
let WARNING_TRIGGER = false;
for (var i = 0; i < json.length; i++) {
let planet = json[i];
let mass = planet['pl_bmassj'];
if (mass && mass >= MAX_INT) {
WARNING_TRIGGER = true;
}
console.log(planet['rowid'] + ' ' + mass);
}
console.log(MAX_INT);
console.log('There are numbers with too large of a value? : ' + WARNING_TRIGGER);
// 9007199254740991
// There are numbers with too large of a value? : false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment