#! perl use strict; use warnings; use Data::Float qw( float_hex hex_float ); my $n = 1 / 7; my $h = float_hex($n); my $d = hex_float($h); print "fraction = $n\nhex = $h\ndecimal = $d\n";