summaryrefslogtreecommitdiff
path: root/t/opbasic
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2016-06-27 18:57:14 -0400
committerJarkko Hietaniemi <jhi@iki.fi>2016-07-01 20:43:13 -0400
commit15899733e6c3ba2d82e9b5373dabc6958554975c (patch)
tree1af5eeba4a61185533358a8d629c3cda6b0c11e5 /t/opbasic
parenta7157111fed730f765c2c281a61bcde95bacc9ed (diff)
downloadperl-15899733e6c3ba2d82e9b5373dabc6958554975c.tar.gz
VAX: test changes for VAX floats
The hexfp (literals or %a) seems to be partially working: simple cases seem to work, but there are failures.
Diffstat (limited to 't/opbasic')
-rw-r--r--t/opbasic/arith.t9
1 files changed, 7 insertions, 2 deletions
diff --git a/t/opbasic/arith.t b/t/opbasic/arith.t
index 79922605df..8aa1e16224 100644
--- a/t/opbasic/arith.t
+++ b/t/opbasic/arith.t
@@ -426,12 +426,13 @@ if ($^O eq 'VMS') {
eval {require Config; import Config};
$vms_no_ieee = 1 unless defined($Config{useieee});
}
+my $vax_float = (pack("d",1) =~ /^[\x80\x10]\x40/);
if ($^O eq 'vos') {
print "not ok ", $T++, " # TODO VOS raises SIGFPE instead of producing infinity.\n";
}
-elsif ($vms_no_ieee) {
- print $T++, " # SKIP -- the IEEE infinity model is unavailable in this configuration.\n"
+elsif ($vms_no_ieee || $vax_float) {
+ print "ok ", $T++, " # SKIP -- the IEEE infinity model is unavailable in this configuration.\n"
}
elsif ($^O eq 'ultrix') {
print "not ok ", $T++, " # TODO Ultrix enters deep nirvana instead of producing infinity.\n";
@@ -460,6 +461,9 @@ else {
# [perl #120426]
# small numbers shouldn't round to zero if they have extra floating digits
+if ($vax_float) {
+for (1..8) { print "ok ", $T++, " # SKIP -- VAX not IEEE\n" }
+} else {
try $T++, 0.153e-305 != 0.0, '0.153e-305';
try $T++, 0.1530e-305 != 0.0, '0.1530e-305';
try $T++, 0.15300e-305 != 0.0, '0.15300e-305';
@@ -469,6 +473,7 @@ try $T++, 0.1530001e-305 != 0.0, '0.1530001e-305';
try $T++, 1.17549435100e-38 != 0.0, 'min single';
# For flush-to-zero systems this may flush-to-zero, see PERL_SYS_FPU_INIT
try $T++, 2.2250738585072014e-308 != 0.0, 'min double';
+}
# string-to-nv should equal float literals
try $T++, "1.23" + 0 == 1.23, '1.23';