|
BitwiseCastToInt64 Method
|
Performs proper bitwise conversion between unsigned and signed value
Namespace: GSFAssembly: GSF.Core (in GSF.Core.dll) Version: 2.4.256-beta+0e7e94d39a9b10efe7e26e3b8d5130afc0dd4d74
Syntaxpublic static long ToInt64(
ulong unsignedInt
)
Public Shared Function ToInt64 (
unsignedInt As ULong
) As Long
GSF.BitwiseCast.ToInt64 = function(unsignedInt);
View SourceParameters
- unsignedInt UInt64
- Unsigned integer that is passed in to be converted to a long.
Return Value
Int64The long value.
RemarksThis function is useful because Convert.ToInt64 will throw an OverflowException for values greater than Int64.MaxValue.
For example, this function correctly converts unsigned 64-bit integer 18446744073709551615 (i.e., UInt64.MaxValue) to signed 64-bit integer -1.
See Also