Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^3: How to increment a MAC Address?

by ikegami (Patriarch)
on Jun 17, 2005 at 23:13 UTC ( [id://467899]=note: print w/replies, xml ) Need Help??


in reply to Re^2: How to increment a MAC Address?
in thread How to increment a MAC Address?

Close, but not quite. You're trying to store a 48bit number into a 32bit variable. (Well, it's 32 bit on my Windows machine.) You have an overflow problem.

my $dec = hex('FF0000000000'); printf("%012x", $dec); __END__ Integer overflow in hexadecimal number at !.pl line 1 0000ffffffff

You could use Math::BigInt, or you could use floating point numbers (doubles) as I've previously detailed.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://467899]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (1)
As of 2024-04-25 19:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found