Take the 2-minute tour ×

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.

share|improve this question
long double is not a g++ extension... –  Johannes Schaub - litb Mar 4 '11 at 21:53
add comment

3 Answers

up vote 33 down vote accepted

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

share|improve this answer
add comment

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.

share|improve this answer
It kinda makes sense that they'd use >? for the maximum operator, seeing that the maximum can be computed in regular C++ like this: max = lhs > rhs ? lhs : rhs. –  Emile Cormier Mar 4 '11 at 21:52
Compiler specific language extensions?! I thought only MS were dumb enough to do that. Boo! Hiss! –  David Heffernan Mar 4 '11 at 21:52
>?= is really quite disgusting though! –  David Heffernan Mar 4 '11 at 21:58
Who ever thought that was readable? –  Loki Astari Mar 4 '11 at 23:42
I didn't know that some perl users had worked on gcc. –  Matthieu M. Mar 5 '11 at 11:26
show 4 more comments

See C extension: ? 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 <?=)

share|improve this answer
add comment

Your Answer


