00001 00002 /* 00003 * $Id: floatsim.h,v 1.1.1.1 2005/01/11 21:18:07 kstevens Exp $ 00004 * 00005 * Author: Markus Stenberg <fingon@iki.fi> 00006 * 00007 * Copyright (c) 1998 Markus Stenberg 00008 * All rights reserved 00009 * 00010 * Created: Mon Jul 20 00:26:46 1998 fingon 00011 * Last modified: Mon Jul 20 00:46:33 1998 fingon 00012 * 00013 */ 00014 00015 #ifndef FLOATSIM_H 00016 #define FLOATSIM_H 00017 00018 /* Simulate floats by using ints in interesting way */ 00019 00020 #define INT_DECIMAL_BITS 8 00021 00022 /* out of 32 */ 00023 #define SHO_DECIMAL_BITS 5 00024 00025 /* out of 16 ; note : this makes signed ints only 0-1023, unsigneds 0-2047 */ 00026 00027 #define FSIM2INT(a) ((a) >> INT_DECIMAL_BITS) 00028 #define FSIM2SHO(a) ((a) >> SHO_DECIMAL_BITS) 00029 #define INT2FSIM(a) ((a) << INT_DECIMAL_BITS) 00030 #define SHO2FSIM(a) ((a) << SHO_DECIMAL_BITS) 00031 00032 #endif /* FLOATSIM_H */