Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add IS-NAN-OR-INF helper sub
This is backend dependent atm, so concentrate backend dependendness
  • Loading branch information
lizmat committed Jan 12, 2015
1 parent 107a5c2 commit d3d2ebb
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/core/operators.pm
Expand Up @@ -353,4 +353,13 @@ sub infix:<andthen>(*@a) {
$current;
}

sub IS-NAN-OR-INF(\val) {
#?if !parrot
nqp::istype(val, Num) && nqp::isnanorinf(val);
#?endif
#?if parrot
nqp::isnanorinf(val);
#?endif
}

# vim: ft=perl6 expandtab sw=4

0 comments on commit d3d2ebb

Please sign in to comment.