Skip to content

Instantly share code, notes, and snippets.

@smooker
Created February 1, 2025 13:54
Show Gist options
  • Save smooker/c37158c06a28b3050d66c3bb80fabfcf to your computer and use it in GitHub Desktop.
Save smooker/c37158c06a28b3050d66c3bb80fabfcf to your computer and use it in GitHub Desktop.
#!/usr/bin/perl
use strict;
use warnings;
use bigint;
my $a1 = $ARGV[0];
if ($a1 =~ m/0x/) {
$a1 = hex($a1);
}
printf("HEX: %64x\n", $a1);
printf("DEC: %64d\n", $a1);
printf("BIN: %0*b\n", 64, $a1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment