in reply to Re^6: Big Int to hex with 5.6
in thread Big Int to hex with 5.6

This works for me on cygwin perl 5.6.2 (Math::BigInt version 0.01):
#!/usr/local/bin/perl5.6.2 use Math::BigInt; BEGIN { if (!exists &Math::BigInt::as_hex) { *Math::BigInt::as_hex = sub { my $i = shift; my $hex = ''; do { my $mod = $i % 16; $hex .= sprintf("%x", $mod); } while $i = $i / 16; scalar reverse $hex; } } } $z = new Math::BigInt("1234567890"x 3); print $z->as_hex();
Slight variations failed completely, though :)

Replies are listed 'Best First'.
Re^8: Big Int to hex with 5.6
by ZlR (Chaplain) on Dec 13, 2004 at 00:56 UTC
    wow !

    it works :)

    thanks a lot, this really saves my day !