Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does a>?=b mean?

Tags:

c++

operators

I found the below code and don't understand what it means:

res>?=m[2]; 

Here's the code to where I found it and some context for it.

vector<int> m(3); int s = 0; ... do stuff with m ... res>?=m[2]; return res; 
like image 520
aled1027 Avatar asked Nov 30 '13 19:11

aled1027


People also ask

What does B mean in texting to a girl?

B is an affectionate term for a loved one. It is often times used to address a homie, ya girl, or ya moms.

What does B mean in math?

Base. In geometry, the base of a shape is the side (usually the bottom) that forms a right (90 degree) angle with the height of the object.

What does a B mean in number theory?

1-17-2019. Divisibility. If a and b are integers, a divides b if there is an integer c such that ac = b. The notation a | b means that a divides b. For example, 3 | 6, since 3·2 = 6.

What does a tilde B mean?

(1) In mathematics, the tilde (~) stands for equivalence; for example, a ~ b means "a is equivalent to b" (not equal, but comparable). It also stands for approximation. Officially written as two tildes, one over the other, the single tilde has become acceptable; for example, ~100 means "approximately 100."


1 Answers

It is an old GCC extension.

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

You may check out Minimum and Maximum Operators in C++

It is very convenient to have operators which return the "minimum" or the "maximum" of two arguments. In GNU C++ (but not in GNU C),

a <? b

is the minimum, returning the smaller of the numeric values a and b;

a >? b

is the maximum, returning the larger of the numeric values a and b.

On a side note:-

These operators are non-standard and are deprecated in GCC. You should use std::min and std::max instead.

like image 139
Rahul Tripathi Avatar answered Sep 22 '22 21:09

Rahul Tripathi