|
BitwiseCastToInt24 Method
|
Performs proper bitwise conversion between unsigned and signed value
Namespace: GSFAssembly: GSF.Core (in GSF.Core.dll) Version: 2.4.232-beta+203aa83a5a82d50f387e69875549969ad138d6e0
SyntaxPublic Shared Function ToInt24 (
unsignedInt As UInt24
) As Int24
GSF.BitwiseCast.ToInt24 = function(unsignedInt);
View SourceParameters
- unsignedInt UInt24
- Unsigned UInt24 that is passed in to be converted to a signed Int24.
Return Value
Int24The Int24 value.
RemarksThis function is useful because CType(n, Int24) will throw an OverflowException for values greater than Int24.MaxValue.
For example, this function correctly converts unsigned 24-bit integer 16777215 (i.e., UInt24.MaxValue) to signed 24-bit integer -1.
See Also