[go: up one dir, main page]

Menu

[ce0c76]: / mexsources / ffloor.c  Maximize  Restore  History

Download this file

24 lines (21 with data), 424 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/*
* This function is needed in the Macintosh MEX-files to very
* quickly round extended numbers on MC68040. This routine is
* a lot faster than 68040 FINTR/FINTRZ instruction.
*
*/
#ifdef ANSI_C
int ffloor(double x)
#else
int ffloor(x)
double x;
#endif
{
int *ii;
char *ic;
extended temp;
ic=&temp;
ii=ic+6;
temp = x + 140739635838976; /* 2^47+2^31 */
return( *ii - 2147483648 ); /* 2^31 */
}