From: Jeff Okamoto Date: Fri, 23 Feb 2001 13:28:33 +0000 (-0800) Subject: PATCH: extra tests to check on negative float to unsigned cast X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=66a74c25c82fcbe144b3c1b3ec54201375341f2b;p=p5sagit%2Fp5-mst-13.2.git PATCH: extra tests to check on negative float to unsigned cast Message-Id: <200102232128.NAA28938@xfiles.corp.hp.com> p4raw-id: //depot/perl@8950 --- diff --git a/t/op/bop.t b/t/op/bop.t index 622d169..0354f00 100755 --- a/t/op/bop.t +++ b/t/op/bop.t @@ -9,7 +9,7 @@ BEGIN { @INC = '../lib'; } -print "1..42\n"; +print "1..44\n"; # numerics print ((0xdead & 0xbeef) == 0x9ead ? "ok 1\n" : "not ok 1\n"); @@ -163,3 +163,9 @@ print "ok 40\n"; # More variations on 19 and 22. print "ok \xFF\x{FF}\n" & "ok 41\n"; print "ok \x{FF}\xFF\n" & "ok 42\n"; + +# Tests to see if you really can do casts negative floats to unsigned properly +$neg1 = -1.0; +print ((~ $neg1 == 0) ? "ok 43\n" : "not ok 43\n"); +$neg7 = -7.0; +print ((~ $neg7 == 6) ? "ok 44\n" : "not ok 44\n");