00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
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>
00021
00022 namespace geos {
00023 namespace 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 }
00097 }
00098
00099 #endif // GEOS_PRECISION_COMMONBITS_H
00100
00101
00102
00103
00104
00105
00106