Get the App
SLTechnology News&Howtos  ›  Development  › 

Will it be more efficient to use shift operation instead of multiplication and division in C language?

Shulou Source: shulou.com Published: 2022-06-02 12:16:04 10月04日 Update

This article introduces the knowledge of "will it be more efficient to use shift operation instead of multiplication and division operation in C language?" in the operation of actual cases, many people will encounter such a dilemma. Next, let the editor lead you to learn how to deal with these situations! I hope you can read it carefully and be able to achieve something!

In C language program development, some shift operations seem to achieve the same effect as multiplication and division operations. For example, 4 > > 1 equals 2, and moving one bit to the right is equivalent to dividing by 2. Similarly, 2

Tags: Language multiplication and division code program efficiency language program multiplication and division multiplication compiler compilation as much as possible faster operation content that is intention more sometimes purpose knowledg Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno vpn MariaDB Xiaomi Apple Shulou Information