Skip to content

Commit

Permalink
Add examples of statements producing NaN
Browse files Browse the repository at this point in the history
  • Loading branch information
zoffixznet committed Sep 1, 2017
1 parent 696b3f4 commit 02e05e6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions doc/Type/Num.pod6
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ a concrete number as the answer is not defined, but a L<Numeric> value is still
accceptable. C<NaN> is L<defined> and L<boolifies|/routine/Bool>
to C<True>, but is I<not> numerically equal to any value (including itself).
say cos ∞; # OUTPUT: «NaN␤»
say (0/0).Num; # OUTPUT: «NaN␤»
To test for C<NaN>, use L<isNaN> method or L<=== operator|/routine/===>:
say (0/0).isNaN; # OUTPUT: «True␤»
Expand Down

0 comments on commit 02e05e6

Please sign in to comment.