40

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.

Yu Hao
  • 119,891
  • 44
  • 235
  • 294
wes
  • 1,577
  • 1
  • 14
  • 32

3 Answers3

52

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);.

Omnifarious
  • 54,333
  • 19
  • 131
  • 194
Thomas Jones-Low
  • 7,001
  • 2
  • 32
  • 36
14

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.

Tim Martin
  • 3,618
  • 6
  • 32
  • 43
3

See C extension: <? and >? operators

It's the max-then-assign operator: Take the greater of the left and right sides and stuff it back into the lefthand side.

It's removed from g++ and should be replaced with max (or min for <?=)

Community
  • 1
  • 1
Mark B
  • 95,107
  • 10
  • 109
  • 188