Hello,
I am working with SNMP and 64 Bit unsigned Intergers.
To give you a view on the different possible values and types I come across:
2147483648 = 10000000000000000000000000000000 = 80000000 = 2^31
4294967296 = 100000000000000000000000000000000 = 100000000 = 2^32
4294967295 = 11111111111111111111111111111111 = FFFFFFFF = 2^32 -1
8589934591 = 111111111111111111111111111111111 = 1FFFFFFFF = 2^33 -1
9223372036854775808 =
1000000000000000000000000000000000000000000000000000000000000000 =
8000000000000000 = 2^63
9223372036854775807 =
111111111111111111111111111111111111111111111111111111111111111 =
7FFFFFFFFFFFFFFF = 2^63 -1
18446744073709551616 =
10000000000000000000000000000000000000000000000000000000000000000 = ?? =
2^64
18446744073709551615 =
1111111111111111111111111111111111111111111111111111111111111111 = ?? =
2^64 - 1
36893488147419103231 =
11111111111111111111111111111111111111111111111111111111111111111 = ?? =
2^65 - 1
The thing that I do is
$var = unpack("N*", $any64bitvalue);
or
$var = unpack("I*", $any64bitvalue);
to make sure the number is an unsigned Interger.
When I access the number in $var (as a string or a number) it has ben
chopped to a 32 Bit number.
Now I tested Math:BigInt $var = Math::BigInt->new(unpack("I*",
$any64bitvalue));
But still on the $var is chopped to 32 Bit in the next subroutine;
This means that the value 36893488147419103231 becomes 8589934591.
I do not have the possibility to use 64 BIT perl.
I am using aix 4.3.3 and I cant tell you it is no fun building a perl there.
BTW: Does anyone knows anything about perl typecasting?
Thx,
Bastian
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]