I have uint64_t hex variable of the double variable, I need to convert it to double.
I am using below function for the converting operation using 8 bits hex array:
double HexToDoubleConverter(uint8_t *hexArray)
{
double convertedValue = 0.0;
memcpy(&convertedValue, hexArray, sizeof(convertedValue));
return convertedValue;
}
And I change with like this:
double U64ToDoubleConverter(uint64_t val)
{
double convertedValue = 0.0;
memcpy(&convertedValue, val, sizeof(convertedValue));
return convertedValue;
}
But it didnt work for me how can I convert correctly?