rjbell4 has asked for the wisdom of the Perl Monks concerning the following question:
That works pretty well, with a couple of exceptions. For one, hex() still uses floats, but that's pretty acceptable and easy to work around.. However, the kicker is that 'use integer' treats all values as signed. That causes problems when doing comparisons. For instance, 0x80000000000000000 will be less than 0x70000000000000000, because the highest bit is set.
I really need to convince perl to treat these as unsigned quantities. For now, I'm doing this by creating an "Address" class, and using operator overloading for "<=>" (and simple overloads for other mathematical operators). However, this is making the code much slower. (I'm dealing with these addresses a lot)
Is there any way I can convince perl to manipulate the values as (essentially) uint64_t's?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: 'use integer;', or Manipulating 64-bit values, revisited
by samtregar (Abbot) on Jun 07, 2002 at 00:59 UTC | |
|
Re: 'use integer;', or Manipulating 64-bit values, revisited
by Zaxo (Archbishop) on Jun 07, 2002 at 00:49 UTC |