Help for this page

Select Code to Download


  1. or download this
    use Math::GMPz qw(:mpz);
    my $z = Math::GMPz->new();
    ...
    $str = chr(ord $v);
    Rmpz_import($z, 1, 1, 1, 0, 0, $str);
    print $z; # prints the value assigned to $v (ie 255).
    
  2. or download this
    use Math::GMPz qw(:mpz);
    my $z = Math::GMPz->new();
    ...
    utf8::upgrade($str);
    Rmpz_import($z, 1, 1, 1, 0, 0, $str);
    print $z; # now prints 195.