mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-30 00:00:11 +01:00
git-svn-id: https://zerberus.eonerc.rwth-aachen.de:8443/svn/s2ss/trunk@178 8ec27952-4edc-4aab-86aa-e87bb2611832
24 lines
257 B
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;
|
|
}
|