From: Nicholas Clark Date: Mon, 11 Dec 2000 01:48:38 +0000 (+0000) Subject: docs on NaN X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7d3a9d88333294f7510d5755825d4f26422ffba1;p=p5sagit%2Fp5-mst-13.2.git docs on NaN Message-ID: <20001211014838.B99205@plum.flirble.org> p4raw-id: //depot/perl@8078 --- diff --git a/pod/perlop.pod b/pod/perlop.pod index 70fef45..0bb506d 100644 --- a/pod/perlop.pod +++ b/pod/perlop.pod @@ -300,8 +300,13 @@ to the right argument. Binary "<=>" returns -1, 0, or 1 depending on whether the left argument is numerically less than, equal to, or greater than the right argument. If your platform supports NaNs (not-a-numbers) as numeric -values, using them with "<=>" (or any other numeric comparison) -returns undef. +values, using them with "<=>" returns undef. NaN is not "<", "==", ">", +"<=" or ">=" anything (even NaN), so those 5 return false. NaN != NaN +returns true, as does NaN != anything else. If your platform doesn't +support NaNs then NaN is just a string with numeric value 0. + + perl -le '$a = NaN; print "No NaN support here" if $a == $a' + perl -le '$a = NaN; print "NaN support here" if $a != $a' Binary "eq" returns true if the left argument is stringwise equal to the right argument.