/* STEREO IMPACT SEP SEPT ** ** L1 Data Processing, Test 14-bit decider ** ** (C) Copyright 2005-2006 Stephan I. Böttcher, CAU Kiel - IEAP ** ** Stephan I. Böttcher ** Reinhold Müller-Mellin ** ** $Id: sept_l1_dec14_test.c,v 1.1 2010/05/31 11:49:35 bottcher Exp $ ** $Log: sept_l1_dec14_test.c,v $ ** Revision 1.1 2010/05/31 11:49:35 bottcher ** add rounding to dec14, test case ** ** */ #include "sept_l1.c" int main() { unsigned int e, m, i, j, c, o; double d; double mi, ma; for (e=0; e<16; e++) for (m=1; m<0x400; m<<=1) for (i=m-1; i=0x800) { e++; m>>=1; } if (e) c = (m&0x3ff) | ((e+1)<<10); else c = m; o = dec14(c); d = (1.0*((int)i-(int)o))/i; if (dma) ma = d; if (!(i%100000) || d && ((d==mi) || (d==ma))) printf("%d %d %d %g\n", e, i, o, d); } printf("ma=%g, mi=%g\n", ma, mi); return 0; }