GEOS 3.6.2
CommonBits.h
1/**********************************************************************
2 *
3 * GEOS - Geometry Engine Open Source
4 * http://geos.osgeo.org
5 *
6 * Copyright (C) 2005-2006 Refractions Research Inc.
7 *
8 * This is free software; you can redistribute and/or modify it under
9 * the terms of the GNU Lesser General Public Licence as published
10 * by the Free Software Foundation.
11 * See the COPYING file for more information.
12 *
13 **********************************************************************/
14
15#ifndef GEOS_PRECISION_COMMONBITS_H
16#define GEOS_PRECISION_COMMONBITS_H
17
18#include <geos/export.h>
19#include <geos/platform.h> // for int64
20
21namespace geos {
22namespace precision { // geos.precision
23
33class GEOS_DLL CommonBits {
34
35private:
36
37 bool isFirst;
38
39 int commonMantissaBitsCount;
40
41 int64 commonBits;
42
43 int64 commonSignExp;
44
45public:
46
54 static int64 signExpBits(int64 num);
55
67 static int numCommonMostSigMantissaBits(int64 num1, int64 num2);
68
76 static int64 zeroLowerBits(int64 bits, int nBits);
77
85 static int getBit(int64 bits, int i);
86
87 CommonBits();
88
89 void add(double num);
90
91 double getCommon();
92
93};
94
95} // namespace geos.precision
96} // namespace geos
97
98#endif // GEOS_PRECISION_COMMONBITS_H
static int numCommonMostSigMantissaBits(int64 num1, int64 num2)
This computes the number of common most-significant bits in the mantissas of two double-precision num...
static int getBit(int64 bits, int i)
Extracts the i'th bit of a bitstring.
static int64 zeroLowerBits(int64 bits, int nBits)
Zeroes the lower n bits of a bitstring.
static int64 signExpBits(int64 num)
Computes the bit pattern for the sign and exponent of a double-precision number.
Provides classes for manipulating the precision model of Geometries.
Definition precision.h:22
Basic namespace for all GEOS functionalities.
Definition IndexedNestedRingTester.h:25