</li><li>Negative infinity is less than all other values and positive infinity is
greater than all non-NaN values.</li><li>All other values are compared using their numeric value.</li></ul>
<p>Examples:</p>
<pre class="language-dart"><code>print(1.compareTo(2)); // =&gt; -1
print(2.compareTo(1)); // =&gt; 1
print(1.compareTo(1)); // =&gt; 0

// The following comparisons yield different results than the
// corresponding comparison operators.
print((-0.0).compareTo(0.0));  // =&gt; -1
print(double.nan.compare