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/platform.h>
00020
00021 namespace geos {
00022 namespace precision {
00023
00033 class CommonBits {
00034
00035 private:
00036
00037 bool isFirst;
00038
00039 int commonMantissaBitsCount;
00040
00041 int64 commonBits;
00042
00043 int64 commonSignExp;
00044
00045 public:
00046
00054 static int64 signExpBits(int64 num);
00055
00067 static int numCommonMostSigMantissaBits(int64 num1, int64 num2);
00068
00076 static int64 zeroLowerBits(int64 bits, int nBits);
00077
00085 static int getBit(int64 bits, int i);
00086
00087 CommonBits();
00088
00089 void add(double num);
00090
00091 double getCommon();
00092
00093 };
00094
00095 }
00096 }
00097
00098 #endif // GEOS_PRECISION_COMMONBITS_H
00099
00100
00101
00102
00103
00104
00105