File:  [Isaki's NoNo m68k/m88k emulator] / nono / m88xx0 / fp.h
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Wed Apr 29 17:04:44 2026 UTC (2 months, 3 weeks ago) by root
Branches: MAIN, Isaki
CVS tags: v008, v007, HEAD
nono 0.1.3


// 何もかも分かった上で暫定

extern float u2f(uint32 u);
extern double u2d(uint64 u);
extern uint32 f2u(float v);
extern uint64 d2u(double v);

float
u2f(uint32 u)
{
	float v;
	memcpy(&v, &u, 4);
	return v;
}

double
u2d(uint64 u)
{
	double v;
	memcpy(&v, &u, 8);
	return v;
}

uint32
f2u(float v)
{
	uint32 u;
	memcpy(&u, &v, 4);
	return u;
}

uint64
d2u(double v)
{
	uint64 u;
	memcpy(&u, &v, 8);
	return u;
}

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.