This works, but it will give you a slight performance hit. Unless you're doing serious number crunching it'll probably be acceptable...
use strict; use warnings; sub hexnum { package HexNum; use base 'Math::BigInt'; use overload q[""] => 'as_hex'; __PACKAGE__->new(@_); } my $var = hexnum 0x2F; $var += 3; $var += hexnum 0x02; print "$var\n";
In reply to Re: I need Hex conversion, not!
by tobyink
in thread I need Hex conversion, not!
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |