in reply to Re: Converting Hexadecimal to Decimal notation and vice-versa
in thread Converting Hexadecimal to Decimal notation and vice-versa

Hi, thanks.
We had an older version of Math::BigInt and that is why it seems it could not locate method from_hex.
How do I convert a huge integer to hexadecimal using Math::BigInt?
  • Comment on Re^2: Converting Hexadecimal to Decimal notation and vice-versa

Replies are listed 'Best First'.
Re^3: Converting Hexadecimal to Decimal notation and vice-versa
by almut (Canon) on Oct 17, 2009 at 18:48 UTC
    How do I convert a huge integer to hexadecimal

    ->as_hex()

      Hi,
      I tried the following and I got 'NaN' as the result.
      #!/usr/bin/perl use strict; use warnings; package main; use Math::BigInt; my $gene_sample_101dcef = Math::BigInt->as_hex("5555181933400000000066 +6"); print $gene_sample_101dcef,"\n";

        You have to call the method on an already existing object instance, for example:

        print Math::BigInt->new("55551819334000000000666")->as_hex(), "\n";