mattgabor
mattgabor

Reputation: 2084

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;   
        }
    };

Upvotes: 0

Views: 109

Answers (2)

Jared Dykstra
Jared Dykstra

Reputation: 3626

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.

Upvotes: 1

user3235832
user3235832

Reputation:

> returns an integer, with value 1 if true and 0 if false.

Upvotes: 1

Related Questions