Skip to main content

Questions tagged [comparison]

Filter by
Sorted by
Tagged with
14 votes
8 answers
1k views

I just thought of this idea: if we have NaN ("not a number") for floats, how about NaC ("not a character") for a single unknown character in a string? Your input should be two ...
3-1-4-One-Five's user avatar
-4 votes
1 answer
286 views

Need to write a JS function compare(a,b) for numbers which return 1 when a > b, 0 when a == b, -1 when a < b. Also following properties should hold: compare(NaN, NaN) = 0 NaN is bigger than any ...
Ihromant's user avatar
20 votes
59 answers
6k views

In C++, there exists a a <=> b three-way comparison operator that, for numerical types, does the following: If a < b, ...
bigyihsuan's user avatar
  • 11.5k