Skip to content
This repository has been archived by the owner on Mar 25, 2024. It is now read-only.

Commit

Permalink
Merge pull request #148 from Oslandia/fix_145
Browse files Browse the repository at this point in the history
Fix build when CGAL is compiled with GMPXX
  • Loading branch information
Hugo Mercier committed Nov 13, 2017
2 parents 46557e0 + 5c495ce commit 5499795
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Coordinate.cpp
Expand Up @@ -266,10 +266,17 @@ class RoundVisitor : public boost::static_visitor<> {


Kernel::FT _roundFT( const Kernel::FT& v ) const {
#ifdef CGAL_USE_GMPXX
return Kernel::FT( ::mpq_class(
SFCGAL::round( v.exact() * _scaleFactor ),
_scaleFactor
) ) ;
#else
return Kernel::FT( CGAL::Gmpq(
SFCGAL::round( v.exact() * _scaleFactor ),
_scaleFactor
) ) ;
#endif
}

};
Expand Down
14 changes: 14 additions & 0 deletions src/numeric.h
Expand Up @@ -57,6 +57,20 @@ inline double round( const double& v )
}
}

#ifdef CGAL_USE_GMPXX
/**
* @brief floor a rational to an integer
*/
SFCGAL_API ::mpz_class floor( const ::mpq_class& v ) ;
/**
* @brief ceil a rational to an integer
*/
SFCGAL_API ::mpz_class ceil( const ::mpq_class& v ) ;
/**
* @brief round a rational to an integer
*/
SFCGAL_API ::mpz_class round( const ::mpq_class& v ) ;
#endif

/**
* @brief floor a rational to an integer
Expand Down

0 comments on commit 5499795

Please sign in to comment.