Forum Discussion
Jitesh_41550
Nimbostratus
Jul 18, 2011Convert CommonULong64 to a meaningful value
Hi,
My goal is to fetch virtual servers/addresses statistics from LTM and display the value on screen. This is effectively mocking the device web console's 'Network Maps'. When queried for stats values of different types are returned in CommonULong64 class which contains two members High and Low. Could someone please guide me on how to convert these two values into one meanigful value (which displays on device web console)?
For ex. High = 2, Low = 477423268 converts to 99.2G
Thanks in advance.
-Jitesh
2 Replies
Sort By
- Hamish
Cirrocumulus
Multiply the high value by 2^32 and add it to the low to get a 64bit number. The code will vary depending on language... But in C it would be something likeunsigned long long result=high<<32+low;
my $quick64=($statValue->{high}*4294967296)+($statValue->{low}<0?(4294967296+$statValue->{low}):$statValue->{low});
- Hamish
Cirrocumulus
Oh... The example you give... Is closer to 9.2GB... Not 9.2GB... (2*4G = 8G).
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects