<=> разве шесть методов сравнения? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

<=> разве шесть методов сравнения?

<=> в этом операторе, как написано, шесть методов сравнения, я насчитал только пять какой шестой?

10th Dec 2017, 6:56 AM
Vagif Nezirov
Vagif Nezirov - avatar
11 Answers
+ 1
English?
10th Dec 2017, 6:57 AM
Lucien
Lucien - avatar
+ 1
<|>|=|>=|<=
10th Dec 2017, 7:40 AM
Vagif Nezirov
Vagif Nezirov - avatar
+ 1
<=> (spaceship) it's a Ruby operator a <=> b: If a < b then return -1 If a == b then return 0 If a > b then return 1 If a and b are not comparable return nil
10th Dec 2017, 8:02 AM
Mickel
Mickel - avatar
0
I tried translating this in Google Translate and got the following: ----------------------- <=> Is it six methods of comparison? <=> In this statement, as written, six methods of comparison, I counted only five of which is the sixth? ----------------------- Either Google Translate didn't translate this well, or the question being asked simply doesn't make sense.
10th Dec 2017, 7:04 AM
David Carroll
David Carroll - avatar
0
yes! Is true
10th Dec 2017, 7:39 AM
Vagif Nezirov
Vagif Nezirov - avatar
0
why six?
10th Dec 2017, 7:39 AM
Vagif Nezirov
Vagif Nezirov - avatar
0
where is "six"
10th Dec 2017, 7:41 AM
Vagif Nezirov
Vagif Nezirov - avatar
0
Doh... I didn't realize the <=> had an actual meaning. Yeah... it makes sense now. I just thought these characters were used as some sort of bullet. Thanks for clarifying Vagif! Would "==" count if you could repeat "="? In some languages, "<>" is similar to "not" or "!=". Could this apply?
10th Dec 2017, 7:44 AM
David Carroll
David Carroll - avatar
0
I don't know. This symbols are not in mathematics. and they symbols have only comparison
10th Dec 2017, 7:56 AM
Vagif Nezirov
Vagif Nezirov - avatar
0
show all six Operation
10th Dec 2017, 9:24 AM
Vagif Nezirov
Vagif Nezirov - avatar
0
"<>" and "==" are missing from the 5 you already listed.
10th Dec 2017, 2:52 PM
David Carroll
David Carroll - avatar