Send feedback on this topic.
Teradata.Client.Provider
GetBits Method (TdDecimal)
Example 



Teradata.Client.Provider Namespace > TdDecimal Structure : GetBits Method
The binary representation of the value of this TdDecimal structure is returned as an array of signed integers.
Syntax
'Declaration
 
Public Function GetBits() As Integer()
'Usage
 
Dim instance As TdDecimal
Dim value() As Integer
 
value = instance.GetBits()
public int[] GetBits()
public:
array<int>^ GetBits(); 

Return Value

An array that contains the number components and meta-data is returned
Remarks
The array that is returned will contain 5 elements:
Example
TdDecimal original = TdDecimal.Parse("945398372646587542.2323");
             
Int32[] result = original.GetBits();
             
//The scaled integer representation of 945398372646587542.2323 
//   is 9453983726465875422323
//The precision is 22 or 0x16
//The scale is 4 or 0x04
//The hex representation of 9453983726465875422323 is 0x20080614DDE423BAC73
//
//The array that will be returned that contains the internal representation will be
//     (0x423BAC73, 0x80614DDE, 0x00000200, 0x00000000, 0x00011604}
//
// Sign = 0x00011604 & 0x00010000 = 0x00010000
// Precision = 0x00011604 & 0x0000FF00 = 0x1600
// Scale = 0x00011604 & 0x000000FF = 0x04
Requirements

Target Platforms: Windows 8.1, Windows 10, Windows Server 2012 R2, Windows Server 2016, Windows Server 2019

See Also

Reference

TdDecimal Structure
TdDecimal Members