简体   繁体   中英

C++ '>' bitwise operator

Anyone know > does in C++ in terms of bitwise operators? Here's an example of it being used:

    void Seed(uint64_t seed){
        Seed(seed>32, seed);
    };

    void Seed(uint32_t high, uint32_t low){
        if((high != low) && low && high){
            DRandomSeedHigh = high;
            DRandomSeedLow = low;   
        }
    };

>返回一个整数,如果为true,则值为1;如果为false,则值为0。

As all the comments say, this is a typo and should be >> .

But your question was about what this does. > is not a bitwise operator, but >> is. It splits an unsigned 64 bit value in two. The bit shift operator is used to get the top 32 bits, while the low 32 bits are passed as the 2nd argument.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM