CommonBits.h
/**********************************************************************
*
* GEOS - Geometry Engine Open Source
* http://geos.osgeo.org
*
* Copyright (C) 2005-2006 Refractions Research Inc.
*
* This is free software; you can redistribute and/or modify it under
* the terms of the GNU Lesser General Public Licence as published
* by the Free Software Foundation.
* See the COPYING file for more information.
*
**********************************************************************/
#pragma once
#include <geos/export.h>
#include <cstdint>
namespace geos {
namespace precision { // geos.precision
class GEOS_DLL CommonBits {
private:
bool isFirst;
int commonMantissaBitsCount;
int64_t commonBits;
int64_t commonSignExp;
public:
static int64_t signExpBits(int64_t num);
static int numCommonMostSigMantissaBits(int64_t num1, int64_t num2);
static int64_t zeroLowerBits(int64_t bits, int nBits);
static int getBit(int64_t bits, int i);
CommonBits();
void add(double num);
double getCommon();
};
} // namespace geos.precision
} // namespace geos
geos::precision::CommonBits::zeroLowerBits
static int64_t zeroLowerBits(int64_t bits, int nBits)
Zeroes the lower n bits of a bitstring.
geos::precision::CommonBits::getBit
static int getBit(int64_t bits, int i)
Extracts the i'th bit of a bitstring.
geos::precision::CommonBits::signExpBits
static int64_t signExpBits(int64_t num)
Computes the bit pattern for the sign and exponent of a double-precision number.
geos::precision::CommonBits::numCommonMostSigMantissaBits
static int numCommonMostSigMantissaBits(int64_t num1, int64_t num2)
This computes the number of common most-significant bits in the mantissas of two double-precision num...
geos::precision
Provides classes for manipulating the precision model of Geometries.
Definition namespaces.h:300
geos
Basic namespace for all GEOS functionalities.
Definition geos.h:38