develooper Front page | perl.perl5.porters | Postings from October 2003

Re: [perl #24091] Not OK: perl v5.8.1 on sgi6-irix-ld 6.5

Thread Next
From:
Tels
Date:
October 7, 2003 11:11
Subject:
Re: [perl #24091] Not OK: perl v5.8.1 on sgi6-irix-ld 6.5
Message ID:
200310072012.15152@bloodgate.com
-----BEGIN PGP SIGNED MESSAGE-----

Moin,

Bingo:

I noticed that _pow() is not tested in bigintc.t at all, and added some tests 
for it, and also some more tests with _root(). Which promptly fail, even on 
my 32 bit system/perl:

# _pow (and _root)
$x = $C->_new(\"81"); $n = $C->_new(\"3");      # 81 ** 3 == 531441
ok (${$C->_str($C->_pow($x,$n))},81 ** 3);
ok (${$C->_str($C->_root($x,$n))},81);			# (81 ** 3) ** 1/3 == 81
ok (${$C->_str($C->_pow($x,$n))},81 ** 3);
ok (${$C->_str($C->_pow($x,$n))},'150094635296999121'); # 531441 ** 3 ==

This produces:

not ok 153
# Test 153 got: '80' (t/bigintc.t at line 219)
#     Expected: '81'
not ok 154
# Test 154 got: '512000' (t/bigintc.t at line 220)
#     Expected: '531441'
not ok 155
# Test 155 got: '134217728000000000' (t/bigintc.t at line 221)
#     Expected: '150094635296999121'

Damn, and I was so proud that v1.67 would be (probably) the first BigInt 
release with no bugfixes over the last version *sigh*

Oh, something fishy is going on:

      print $x->[0] ** (1 / $n->[0]), "\n";
      $x->[0] = int( $x->[0] ** (1 / $n->[0]) );
      print $x->[0],"\n";

This produces for $x == [ 81 **3 ] and $n == [3] the following output:

	81
	80

Huh?!? This is with Perl v5.8.0...

Best wishes,

Tels

- -- 
 Signed on Tue Oct  7 20:06:36 2003 with key 0x93B84C15.
 Visit my photo gallery at http://bloodgate.com/photos/
 PGP key on http://bloodgate.com/tels.asc or per email.

 "Remember: If the game let's you do it, it's not cheating." -- Xarax

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2-rc1-SuSE (GNU/Linux)
Comment: When cryptography is outlawed, bayl bhgynjf jvyy unir cevinpl.

iQEVAwUBP4MB/XcLPEOTuEwVAQF1ogf/S4MeQIvUDcYDIIK9CTPbfETse1sLZ1fV
I2Cxb4CVrqor/z+/nBLtIz5o9qSp2gpgWUPMPlWj/tcsi8glNzj/ZXpNkmLjC4ID
FFfPaZPMTAOjybg9jovcw2BrSqy0Uo4/L5f8Yxyf7t8q4uC+dJEJuUPVJbOEKdr4
+RU5qYKppQ7ktoW0wth+9bEAPSuV/seRrO2cm7HVQ7MaZAMM7WLBiD9fEJnU8I7c
JcVX5Y45qKyt6Q+CJdiV7qi+kenxaU0psGmcch0PgksjsnxL+fzS+7hs3NAj4iBB
IVtUo9tXgVwcidzg0b9xV9/KVFqwBMJjWR9I8zYnzGP0/IImFf9PMQ==
=8Z0M
-----END PGP SIGNATURE-----


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About