Get the App
SLTechnology News&Howtos  ›  Development  › 

How js uses bit operators to round up

Shulou Source: shulou.com Published: 2022-06-01 05:13:12 09月23日 Update

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!

Tags: Articles operators operations content not much most more knowledge industry negative numbers information information channels channels references learning help Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Huawei Xiaomi Shulou Information MariaDB MySQL