Skip to content
Snippets Groups Projects
Commit 38896f4b authored by Soeren Peters's avatar Soeren Peters
Browse files

Use round instead int cast(double + 0.5)

parent 8431ee7a
No related branches found
No related tags found
No related merge requests found
......@@ -11,6 +11,7 @@
#include <geometry3d/KdTree/splitalgorithms/KdSplitAlgorithm.h>
#include <string>
#include <cmath>
namespace Kd
{
......@@ -66,8 +67,8 @@ namespace Kd
// create a copy of triangles
MbSmartPtr< std::vector<GbTriFaceMesh3D::TriFace> > triFaces(new std::vector<GbTriFaceMesh3D::TriFace>(*mesh.getTriangles() ) );
int maxLevel = (int)(8.0 + 1.3 * std::log( (double)triFaces->size() ) + 0.5);
const int maxLevel = static_cast<int>(lround(8.0 + 1.3 * std::log( (double)triFaces->size() ))); //TODO: remove magic numbers
rootNode = new Node<T>( T( mesh.getX1Minimum() )
, T( mesh.getX2Minimum() )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment