Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does the >?= operator mean?

Tags:

c++

operators

g++

Looking through this C++ BigInt library and found the BigInt.cpp file. At the top there is a a comment at the top about compatibility:

This class was written for the g++ compiler and uses some of the g++ extensions (like "long double" and the ">?=" operator).

What does that >?= operator do? I can't find a reference to it anywhere else.

like image 731
wes Avatar asked Mar 04 '11 21:03

wes


People also ask

What is the meaning of >> operator?

The right shift operator ( >> ) returns the signed number represented by the result of performing a sign-extending shift of the binary representation of the first operand (evaluated as a two's complement bit string) to the right by the number of bits, modulo 32, specified in the second operand.

What does &= mean in C?

It means to perform a bitwise operation with the values on the left and right-hand side, and then assign the result to the variable on the left, so a bit of a short form.


2 Answers

It's a GCC extension that was removed in GCC version 4.2 and later.

The equivalent of a >?= b is a = max(a,b);

There is also a very similar operator a <?= b which means the same as a = min(a, b);.

like image 99
Thomas Jones-Low Avatar answered Sep 19 '22 06:09

Thomas Jones-Low


This page describes that >? is the 'maximum' operator, which returns the largest of its two numeric arguments. I'm guessing that the >?= combines this with assignment, presumably by assigning to the left-hand operand if the right-hand value is larger.

like image 28
Tim Martin Avatar answered Sep 20 '22 06:09

Tim Martin