1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-30 00:00:11 +01:00
VILLASnode/clients/opal/models/send_receive/src/utils.c

24 lines
257 B
C

#include "utils.h"
static union fi {
float f;
uint32_t i;
};
inline float ntohf(float flt)
{
union fi u = { .f = flt };
u.i = ntohl(u.i);
return u.f;
}
inline float htonf(float flt)
{
union u = { .f = flt };
u.i = htonl(u.i);
return u.f;
}