,1,1),"+10"), $scale);
	    } else {
		&norm(&round(substr($xm,0,$xe),
		      "+0".substr($xm,$xe,1),"+10"), $scale);
	    }
	}
    }
}
    
# compare 2 values returns one of undef, <0, =0, >0
#   returns undef if either or both input value are not numbers
sub main'fcmp #(fnum_str, fnum_str) return cond_code
{
    local($x, $y) = (&'fnorm($_[0]),&'fnorm($_[1]));
    if ($x eq "NaN" || $y eq "NaN") {
	undef;
    } else {
	ord($y) <=> ord($x)
	||
	(  local($xm,$xe,$ym,$ye) = split('E', $x."E$y"),
	     (($xe <=> $ye) * (substr($x,0,1).'1')
             || &bigint'cmp($xm,$ym))
	);
    }
}
