示例#1
0
文件: fptest.c 项目: AliSayed/MoSync
int MAMain() {
	double SDA = sin(0.0981746875);	//(0x3fb921f9f01b866e) sin error, returning 1
	//) returned 0x000000003ff00000(5.29980882362664E-315)

	InitConsole();
	printf("Floating test");

	DUMPDH(179.288537549407);
	DUMPDH(SDA);

	//return 0;

	Extent scrSize = maGetScrSize();
	scrSize = EXTENT(176, 208);
	double d;

	d = __adddf3(__floatsidf(EXTENT_X(scrSize)), __muldf3(__floatsidf(EXTENT_Y(scrSize)), 63.25));


	d /= 0.0;	//division by zero.

	DUMPD(__floatsidf(EXTENT_X(scrSize)));
	DUMPD(__floatsidf(EXTENT_Y(scrSize)));
	DUMPD(63.25);
	DUMPD(__muldf3(__floatsidf(EXTENT_Y(scrSize)), 63.25));
	d = __adddf3(__floatsidf(EXTENT_X(scrSize)), __divdf3(__floatsidf(EXTENT_Y(scrSize)), 63.25));
	printf("%f %i", d, __fixdfsi(d));
	printf("%f %i", __floatsidf(42), __fixdfsi(__floatsidf(42)));
	printf("%f %i", 63.25, __fixdfsi(63.25));

	printf("%i", dcmp(63.25, 42.0));
	printf("%i", dcmp(42.0, 63.25));
	printf("%i", dcmp(42.0, 42.0));

	DUMPDH(63.25);
	DUMPDH(42.0);
	DUMPDH(__negdf2(63.25));
	DUMPDH(__negdf2(42.0));
	DUMPDH(-63.25);
	DUMPDH(-42.0);
	DUMPDH(2.1470*1000000000.0);
	DUMPDH(2.1475*1000000000.0);	//vsprintf has a bug

	//wait for keypress, then exit
	printf("Press 0 to exit\n");
	FREEZE;
	return 0;
}
示例#2
0
double
__floathidf (int u)
{
  return __floatsidf ((long)u);
}
double ARMFP_EXPORT __floatunsidf(unsigned int n)
{
    return __floatsidf((int)n);
}
示例#4
0
double __aeabi_i2d(int i)
{
	return __floatsidf(i);
}