Forum Discussion
Mike_Thompson_9
Nimbostratus
Aug 08, 2007CommonULong64 OverflowException
I am trying to convert the CommonULong64 type to UInt64 in .NET for a CommonStatistic type. Sometimes this works fine and I get a good number back. Other times I get a System.OverflowException. The...
Mike_Thompson_9
Nimbostratus
Aug 10, 2007I converted your code to VB (yes, VB) and it does work. Considering speed, do you think your method is faster:
Public Shared Function Build64(ByVal value As Object) As UInt64
Dim High As Int32 = value.high
Dim Low As Int32 = value.low
Dim lowLow As Int32 = value.low And &HFFFF
Dim lowHigh As Int32 = (value.low >> 16) And &HFFFF
Dim high64 As UInt64 = Convert.ToUInt64(High)
Dim lowLow64 As UInt64 = Convert.ToUInt64(lowLow)
Dim lowHigh64 As UInt64 = Convert.ToUInt64(lowHigh)
Dim final As UInt64 = (high64 << 32) Or (lowHigh64 << 16) Or lowLow64
Return myfinal
End Function
Mike
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