Just a thought, but if I had to guess, isNaN, probably checks to see if it got a NAN error from the FPU, if so, the quickest way would be to craft your own— but to get your hands on the FPU you would have to go low level (i.e. 'C' or asm) sooner or later...
Question, does Perl's SIGNAL tie to this exception?
hsm