What is the meanin of "~~" sign? | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
+ 2

What is the meanin of "~~" sign?

i see codes use: ~~Math.random... What is the use?

26th Oct 2018, 7:25 AM
Jingga Sona
Jingga Sona - avatar
4 Réponses
+ 4
~ is the bitwise NOT operator. First, it gets rid of the decimal place (if any), then, it “nots” the number. Two ~s would: first get rid of the decimal place, second “not” the number, then third “not” the new number again. That would get rid of the decimal place, so it’s the same as Math.floor. Further info on bitwise NOT: https://www.sololearn.com/learn/4076/?ref=app
26th Oct 2018, 7:41 AM
Rowsej
Rowsej - avatar
+ 3
Jingga Sona 🐺 [HOWLING] No worries! Also... 🐤 me chicken [PECKING]!
26th Oct 2018, 7:48 AM
Rowsej
Rowsej - avatar
+ 2
Rowsej lol 😂😂
26th Oct 2018, 7:49 AM
Jingga Sona
Jingga Sona - avatar
+ 1
Rowsej oh i get it! Thanks again!😊😊😊
26th Oct 2018, 7:45 AM
Jingga Sona
Jingga Sona - avatar