Mega Code Archive

 
Categories / Visual C++ .NET / Data Type
 

Break decimal up into 4 parts

#include "stdafx.h" using namespace System; void main() {     Decimal a = (Decimal)123456789012345000000.00000000;     Console::WriteLine( a );       array<int>^ d = Decimal::GetBits(a);     Console::WriteLine( d[0] );                   Console::WriteLine( d[1] );                   Console::WriteLine( d[2] );                   Console::WriteLine( d[3].ToString("X") ); }