#!/usr/bin/perl -w $pinf = 1e9999; # positive infinity $ninf = -$pinf; # negative infinity $nan = $pinf/$pinf; # not a number $\ = "\n"; print "pos inf: ", $pinf; print "neg inf: ", $ninf; print "not a num: ", $nan; print "two pos inf: ", 2 * $pinf; print "two nan: ", 2 * $nan; #prints, as it should, according to the IEEE spec #pos inf: Infinity #neg inf: -Infinity #not a num: NaN #two pos inf: Infinity #two nan: NaN print "NaN ", NaN,"\n";