ES6 - Fonction Math.log2 (x)

Renvoie le logarithme en base 2 de X.

Syntaxe

Math.log2(x)

Paramètre

  • X - représente un nombre

Exemple

console.log("---Math.log2()---") 
console.log("Math.log2(2): "+Math.log2(2)) 
console.log("Math.log2(5): "+Math.log2(5))

Production

---Math.log2()--- 
Math.log2(2): 1 
Math.log2(5): 2.321928094887362