Will I possibly loose any decimal digits (precision) when multiplying Number.MAX_SAFE_INTEGER
by Math.random()
in JavaScript?
I presume I won't but it'd be nice to have a credible explanation as to why đ
const max = Number.MAX_SAFE_INTEGER;
const random = Math.random();
console.log(`\
MAX_SAFE_INTEGER: ${max}, \
random: ${random}, \
product: ${max * random}`);
Aucun commentaire:
Enregistrer un commentaire