How js uses bit operators to round up
Editor to share with you how js uses bit operators to rounding, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's learn about it!
Use ~, > >, >, and | to round up
It is equivalent to using Math.floor ()
Console.log (11.71) / / 11 console.log (11.71 > 0) / / 11 console.log (11.71 > 0) / / 11
Note > > cannot round negative numbers
The above is all the content of the article "how js uses bit operators to round up". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!