GEOS
3.2.3
|
00001 /********************************************************************** 00002 * $Id: CommonBits.h 2556 2009-06-06 22:22:28Z strk $ 00003 * 00004 * GEOS - Geometry Engine Open Source 00005 * http://geos.refractions.net 00006 * 00007 * Copyright (C) 2005-2006 Refractions Research Inc. 00008 * 00009 * This is free software; you can redistribute and/or modify it under 00010 * the terms of the GNU Lesser General Public Licence as published 00011 * by the Free Software Foundation. 00012 * See the COPYING file for more information. 00013 * 00014 **********************************************************************/ 00015 00016 #ifndef GEOS_PRECISION_COMMONBITS_H 00017 #define GEOS_PRECISION_COMMONBITS_H 00018 00019 #include <geos/export.h> 00020 #include <geos/platform.h> // for int64 00021 00022 namespace geos { 00023 namespace precision { // geos.precision 00024 00034 class GEOS_DLL CommonBits { 00035 00036 private: 00037 00038 bool isFirst; 00039 00040 int commonMantissaBitsCount; 00041 00042 int64 commonBits; 00043 00044 int64 commonSignExp; 00045 00046 public: 00047 00055 static int64 signExpBits(int64 num); 00056 00068 static int numCommonMostSigMantissaBits(int64 num1, int64 num2); 00069 00077 static int64 zeroLowerBits(int64 bits, int nBits); 00078 00086 static int getBit(int64 bits, int i); 00087 00088 CommonBits(); 00089 00090 void add(double num); 00091 00092 double getCommon(); 00093 00094 }; 00095 00096 } // namespace geos.precision 00097 } // namespace geos 00098 00099 #endif // GEOS_PRECISION_COMMONBITS_H 00100 00101 /********************************************************************** 00102 * $Log$ 00103 * Revision 1.1 2006/03/23 09:17:19 strk 00104 * precision.h header split, minor optimizations 00105 * 00106 **********************************************************************/