简体   繁体   English

C ++'>'按位运算符

[英]C++ '>' bitwise operator

Anyone know > does in C++ in terms of bitwise operators? 有人知道>在C ++中按位运算符表示吗? 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. 它将一个无符号的64位值一分为二。 The bit shift operator is used to get the top 32 bits, while the low 32 bits are passed as the 2nd argument. 移位运算符用于获取高32位,而低32位作为第二个参数传递。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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