What does “compares less than zero” mean?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}
I have posted a question on Stack Overflow about a curious usage of the verb "to compare" in a paper I read:
The expression a <=> b returns an object that compares <0 if a < b,
compares >0 if a > b, and compares ==0 if a and b are
equal/equivalent.
Translation:
The expression blah-blah returns an object that compares less than zero if blah-blah...
Does this sentence make sense in English? Is this some kind of jargon used by programmers? Is it even grammatical and makes any sense? If so, what exactly does it mean?
grammaticality meaning-in-context terminology
add a comment |
I have posted a question on Stack Overflow about a curious usage of the verb "to compare" in a paper I read:
The expression a <=> b returns an object that compares <0 if a < b,
compares >0 if a > b, and compares ==0 if a and b are
equal/equivalent.
Translation:
The expression blah-blah returns an object that compares less than zero if blah-blah...
Does this sentence make sense in English? Is this some kind of jargon used by programmers? Is it even grammatical and makes any sense? If so, what exactly does it mean?
grammaticality meaning-in-context terminology
It’s more or less understandable in context as meaning “evaluates to less than zero”, but it’s certainly not something I’ve ever seen before. It may be more or less conventional jargon in C++-speak, but I don’t remember coming across it before. Then again, I don’t know the first thing about C++, so I wouldn’t be likely to know that.
– Janus Bahs Jacquet
Nov 26 '17 at 18:50
Thank you!! I am so glad I asked! Can you give me a definitive answer based exclusively on English grammar?
– q-l-p
Nov 26 '17 at 18:57
1
... English grammar often tends to be in dispute rather than able to provide definitive answers. Different registers accept different usages.
– Edwin Ashworth
Nov 26 '17 at 22:57
The language here is a bit odd. A better explanation can be found at blog.tartanllama.xyz/spaceship-operator. The operator does: (a <=> b) < 0 //true if a < b, or (a <=> b) > 0 //true if a > b, or (a <=> b) == 0 //true if a is equal/equivalent to b. You compare the result of the spaceship operator to 0, but I don't think that it's natural to say it "compares <0". That sounds like bad documentation.
– jimm101
May 24 at 19:01
add a comment |
I have posted a question on Stack Overflow about a curious usage of the verb "to compare" in a paper I read:
The expression a <=> b returns an object that compares <0 if a < b,
compares >0 if a > b, and compares ==0 if a and b are
equal/equivalent.
Translation:
The expression blah-blah returns an object that compares less than zero if blah-blah...
Does this sentence make sense in English? Is this some kind of jargon used by programmers? Is it even grammatical and makes any sense? If so, what exactly does it mean?
grammaticality meaning-in-context terminology
I have posted a question on Stack Overflow about a curious usage of the verb "to compare" in a paper I read:
The expression a <=> b returns an object that compares <0 if a < b,
compares >0 if a > b, and compares ==0 if a and b are
equal/equivalent.
Translation:
The expression blah-blah returns an object that compares less than zero if blah-blah...
Does this sentence make sense in English? Is this some kind of jargon used by programmers? Is it even grammatical and makes any sense? If so, what exactly does it mean?
grammaticality meaning-in-context terminology
grammaticality meaning-in-context terminology
edited May 24 at 17:35
q-l-p
asked Nov 26 '17 at 17:53
q-l-pq-l-p
1715 bronze badges
1715 bronze badges
It’s more or less understandable in context as meaning “evaluates to less than zero”, but it’s certainly not something I’ve ever seen before. It may be more or less conventional jargon in C++-speak, but I don’t remember coming across it before. Then again, I don’t know the first thing about C++, so I wouldn’t be likely to know that.
– Janus Bahs Jacquet
Nov 26 '17 at 18:50
Thank you!! I am so glad I asked! Can you give me a definitive answer based exclusively on English grammar?
– q-l-p
Nov 26 '17 at 18:57
1
... English grammar often tends to be in dispute rather than able to provide definitive answers. Different registers accept different usages.
– Edwin Ashworth
Nov 26 '17 at 22:57
The language here is a bit odd. A better explanation can be found at blog.tartanllama.xyz/spaceship-operator. The operator does: (a <=> b) < 0 //true if a < b, or (a <=> b) > 0 //true if a > b, or (a <=> b) == 0 //true if a is equal/equivalent to b. You compare the result of the spaceship operator to 0, but I don't think that it's natural to say it "compares <0". That sounds like bad documentation.
– jimm101
May 24 at 19:01
add a comment |
It’s more or less understandable in context as meaning “evaluates to less than zero”, but it’s certainly not something I’ve ever seen before. It may be more or less conventional jargon in C++-speak, but I don’t remember coming across it before. Then again, I don’t know the first thing about C++, so I wouldn’t be likely to know that.
– Janus Bahs Jacquet
Nov 26 '17 at 18:50
Thank you!! I am so glad I asked! Can you give me a definitive answer based exclusively on English grammar?
– q-l-p
Nov 26 '17 at 18:57
1
... English grammar often tends to be in dispute rather than able to provide definitive answers. Different registers accept different usages.
– Edwin Ashworth
Nov 26 '17 at 22:57
The language here is a bit odd. A better explanation can be found at blog.tartanllama.xyz/spaceship-operator. The operator does: (a <=> b) < 0 //true if a < b, or (a <=> b) > 0 //true if a > b, or (a <=> b) == 0 //true if a is equal/equivalent to b. You compare the result of the spaceship operator to 0, but I don't think that it's natural to say it "compares <0". That sounds like bad documentation.
– jimm101
May 24 at 19:01
It’s more or less understandable in context as meaning “evaluates to less than zero”, but it’s certainly not something I’ve ever seen before. It may be more or less conventional jargon in C++-speak, but I don’t remember coming across it before. Then again, I don’t know the first thing about C++, so I wouldn’t be likely to know that.
– Janus Bahs Jacquet
Nov 26 '17 at 18:50
It’s more or less understandable in context as meaning “evaluates to less than zero”, but it’s certainly not something I’ve ever seen before. It may be more or less conventional jargon in C++-speak, but I don’t remember coming across it before. Then again, I don’t know the first thing about C++, so I wouldn’t be likely to know that.
– Janus Bahs Jacquet
Nov 26 '17 at 18:50
Thank you!! I am so glad I asked! Can you give me a definitive answer based exclusively on English grammar?
– q-l-p
Nov 26 '17 at 18:57
Thank you!! I am so glad I asked! Can you give me a definitive answer based exclusively on English grammar?
– q-l-p
Nov 26 '17 at 18:57
1
1
... English grammar often tends to be in dispute rather than able to provide definitive answers. Different registers accept different usages.
– Edwin Ashworth
Nov 26 '17 at 22:57
... English grammar often tends to be in dispute rather than able to provide definitive answers. Different registers accept different usages.
– Edwin Ashworth
Nov 26 '17 at 22:57
The language here is a bit odd. A better explanation can be found at blog.tartanllama.xyz/spaceship-operator. The operator does: (a <=> b) < 0 //true if a < b, or (a <=> b) > 0 //true if a > b, or (a <=> b) == 0 //true if a is equal/equivalent to b. You compare the result of the spaceship operator to 0, but I don't think that it's natural to say it "compares <0". That sounds like bad documentation.
– jimm101
May 24 at 19:01
The language here is a bit odd. A better explanation can be found at blog.tartanllama.xyz/spaceship-operator. The operator does: (a <=> b) < 0 //true if a < b, or (a <=> b) > 0 //true if a > b, or (a <=> b) == 0 //true if a is equal/equivalent to b. You compare the result of the spaceship operator to 0, but I don't think that it's natural to say it "compares <0". That sounds like bad documentation.
– jimm101
May 24 at 19:01
add a comment |
1 Answer
1
active
oldest
votes
P compares less than zero means: evaluating the statement "P < 0" returns "true". It could be that the "object" P is a number which is less than zero, or it could be that it is not a number at all but some other type of object which (by convention) has this property.
"This property" meaning that (by definition) comparison of this object with some number, at least with 0, is a valid operation with the value "true" in the defined cases.
– Bobby J
May 24 at 19:49
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "97"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fenglish.stackexchange.com%2fquestions%2f419939%2fwhat-does-compares-less-than-zero-mean%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
P compares less than zero means: evaluating the statement "P < 0" returns "true". It could be that the "object" P is a number which is less than zero, or it could be that it is not a number at all but some other type of object which (by convention) has this property.
"This property" meaning that (by definition) comparison of this object with some number, at least with 0, is a valid operation with the value "true" in the defined cases.
– Bobby J
May 24 at 19:49
add a comment |
P compares less than zero means: evaluating the statement "P < 0" returns "true". It could be that the "object" P is a number which is less than zero, or it could be that it is not a number at all but some other type of object which (by convention) has this property.
"This property" meaning that (by definition) comparison of this object with some number, at least with 0, is a valid operation with the value "true" in the defined cases.
– Bobby J
May 24 at 19:49
add a comment |
P compares less than zero means: evaluating the statement "P < 0" returns "true". It could be that the "object" P is a number which is less than zero, or it could be that it is not a number at all but some other type of object which (by convention) has this property.
P compares less than zero means: evaluating the statement "P < 0" returns "true". It could be that the "object" P is a number which is less than zero, or it could be that it is not a number at all but some other type of object which (by convention) has this property.
answered May 24 at 18:47
GEdgarGEdgar
15k2 gold badges24 silver badges47 bronze badges
15k2 gold badges24 silver badges47 bronze badges
"This property" meaning that (by definition) comparison of this object with some number, at least with 0, is a valid operation with the value "true" in the defined cases.
– Bobby J
May 24 at 19:49
add a comment |
"This property" meaning that (by definition) comparison of this object with some number, at least with 0, is a valid operation with the value "true" in the defined cases.
– Bobby J
May 24 at 19:49
"This property" meaning that (by definition) comparison of this object with some number, at least with 0, is a valid operation with the value "true" in the defined cases.
– Bobby J
May 24 at 19:49
"This property" meaning that (by definition) comparison of this object with some number, at least with 0, is a valid operation with the value "true" in the defined cases.
– Bobby J
May 24 at 19:49
add a comment |
Thanks for contributing an answer to English Language & Usage Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fenglish.stackexchange.com%2fquestions%2f419939%2fwhat-does-compares-less-than-zero-mean%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
It’s more or less understandable in context as meaning “evaluates to less than zero”, but it’s certainly not something I’ve ever seen before. It may be more or less conventional jargon in C++-speak, but I don’t remember coming across it before. Then again, I don’t know the first thing about C++, so I wouldn’t be likely to know that.
– Janus Bahs Jacquet
Nov 26 '17 at 18:50
Thank you!! I am so glad I asked! Can you give me a definitive answer based exclusively on English grammar?
– q-l-p
Nov 26 '17 at 18:57
1
... English grammar often tends to be in dispute rather than able to provide definitive answers. Different registers accept different usages.
– Edwin Ashworth
Nov 26 '17 at 22:57
The language here is a bit odd. A better explanation can be found at blog.tartanllama.xyz/spaceship-operator. The operator does: (a <=> b) < 0 //true if a < b, or (a <=> b) > 0 //true if a > b, or (a <=> b) == 0 //true if a is equal/equivalent to b. You compare the result of the spaceship operator to 0, but I don't think that it's natural to say it "compares <0". That sounds like bad documentation.
– jimm101
May 24 at 19:01