This question is opposite to my another this question. I need to do opposite operation. I have c# decimal which I need to convert to this structure:
public struct significand
{
public uint mantissa; // or ulong
public sbyte exponent;
}
I pass this structure to c++ library via p/invoke later. How can I convert decimal
to this structure? I guess probably I should use Decimal.GetBits
method somehow? Or probably I can declare c++ structure some way so decimal will be automatically converted to it (i think they should be binary-compatible). Currently i'm using such c++ struct:
struct significand_t
{
uint32_t mantissa;
int8_t exponent;
};