in reply to Re^5: Big Int to hex with 5.6
in thread Big Int to hex with 5.6
I'm trying to find a way to do something similar but from dec to hex . Maybe you have an idea ?#!perl use strict; use Math::BigInt; sub HeX { my $n = shift; $n = '0' x (4 - (length($n) % 4)) . $n; my $m = Math::BigInt->new(0); while (my $o = substr($n, 0, 4, '')){ $m = $m * 65536 + hex $o; } $m; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^7: Big Int to hex with 5.6
by ysth (Canon) on Dec 13, 2004 at 00:42 UTC | |
by ZlR (Chaplain) on Dec 13, 2004 at 00:56 UTC | |
|
Re^7: Big Int to hex with 5.6
by fglock (Vicar) on Dec 13, 2004 at 04:06 UTC |