Skip to content

Commit

Permalink
Make sure NaN, Inf etc are Perl 6 Nums, not Parrot Floats, so we disp…
Browse files Browse the repository at this point in the history
…atch to the right sin, etc.
  • Loading branch information
jnthn committed Feb 13, 2010
1 parent b7fb2e1 commit 6090323
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions src/cheats/num.pm
Expand Up @@ -6,7 +6,20 @@ augment class Num {

INIT {
pir::set_hll_global__vSP('NaN', pir::set__NS('NaN'));
pir::set_hll_global__vSP('Inf', pir::set__NS('Inf'));
pir::set_hll_global__vSP('+Inf', pir::set__NS('Inf'));
pir::set_hll_global__vSP('-Inf', -pir::set__NS('Inf'));
pir::set_hll_global__vSP('NaN', Q:PIR {
%r = new ['Num']
$N0 = 'NaN'
assign %r, $N0
});
pir::set_hll_global__vSP('Inf', Q:PIR {
%r = new ['Num']
$N0 = 'Inf'
assign %r, $N0
});
pir::set_hll_global__vSP('+Inf', Q:PIR {
%r = new ['Num']
$N0 = 'Inf'
assign %r, $N0
});
pir::set_hll_global__vSP('-Inf', -pir::get_hll_global__PS('Inf'));
}

0 comments on commit 6090323

Please sign in to comment.