Files
cgal/Apollonius_graph_2/generators/include/CGAL/bits.h
T
Sébastien Loriot 52317dd49f add python script (replace_CGAL_NAMESPACE.py) to replace CGAL_BEGIN_NAMESPACE and CGAL_END_NAMESPACE
by namespace CGAL { and } //namespace CGAL. in all .h and .cpp files
in a directory.
Apply it to all packages in the trunk
Remove macro definition from the config.h file.
2010-06-09 07:37:13 +00:00

24 lines
371 B
C++

#ifndef CGAL_BITS_H
#define CGAL_BITS_H
#include <CGAL/basic.h>
#include <cmath>
namespace CGAL {
double log2(double x)
{
return log10(x) / log10(2.0);
}
unsigned int bits(double x)
{
CGAL_precondition( static_cast<int>(x) == x );
if ( x == 0 ) { return 1; }
return static_cast<unsigned int>(log2( fabs(x) )) + 1;
}
} //namespace CGAL
#endif // CGAL_BITS_H