in other words,
a > = b
equals
astatb | | a > b
or
a > b | | astatableb?
in other words,
a > = b
equals
astatb | | a > b
or
a > b | | astatableb?
if it is equal to this, the program will be slower. I think it should be equal to a = = b | | a > b.
That's not true. Your platform will not split > = into = and > . The implementation varies from platform to platform and compiler to compiler. From Assembly ( https://godbolt.org/g/6MCvQq):
if (a >= b)
= >
mov eax, dword ptr [rbp - 12]
cmp eax, dword ptr [rbp - 16]
jl .LBB0_4
< hr >
if (a > b)
= >
cmp r8d, dword ptr [rbp - 16]
mov dword ptr [rbp - 20], eax -sharp 4-byte Spill
jle .LBB0_2
Both have 3 instructions.
Also take a look at these awesome answers: https://stackoverflow.com/que.
< hr > Both are true. | | is logic or operator in some languages (which belongs to logic operators). I assume you have limited the symbols to cPP (because you didn't use the more general terms like logic or and logic and . In standard ml, logic or is expressed as or , same for logic and )
In cPP, please correct = to = . The former is a Direct assignment operator, while the latter is Equal to operator. If a satisfy the condition, the b will not be used. For example:
if (a && b)
is equal to
if (a)
if(b)
...
BTW, in some algorithms, if you want to judge if a node exists (like arr [x] [y] = ='x' ), it should be put in b rather than a . Because sometimes a is used to filter out-of-range conditions.
are all right, |
a > b | a = = b equivalent to a = b | a > b , | is true.
a > b || a == b a > b | | a = b, a = = b | | a > b, both of them are the same
Why do I think there is no difference between them