Click or drag to resize

BitwiseCastToInt24 Method

Performs proper bitwise conversion between unsigned and signed value

Namespace: GSF
Assembly: GSF.Core (in GSF.Core.dll) Version: 2.4.256-beta+0e7e94d39a9b10efe7e26e3b8d5130afc0dd4d74
Syntax
public static Int24 ToInt24(
	UInt24 unsignedInt
)
View Source

Parameters

unsignedInt  UInt24
Unsigned UInt24 that is passed in to be converted to a signed Int24.

Return Value

Int24
The Int24 value.
Remarks

This 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