#include <CGAL/IO/io.h>
#include <CGAL/Algebraic_structure_traits.h>
#include <CGAL/number_utils.h>
template< typename NT > NT unit_part(const NT& x);
template< typename NT >
template< typename NT >
template< typename NT >
NT unit_part(const NT& x){
if (x == 0 ) return NT(1);
typedef typename AST::Algebraic_category Algebraic_category;
return unit_part_(x,Algebraic_category());
}
template< typename NT >
}
template< typename NT >
return x;
}
int main(){
std::cout<<
"int: unit_part(-3 ): " <<
unit_part(-3 ) << std::endl;
std::cout<<
"double: unit_part(-3.0): " <<
unit_part(-3.0) << std::endl;
return 0;
}
An instance of Algebraic_structure_traits is a model of AlgebraicStructureTraits, where T is the asso...
Definition: Algebraic_structure_traits.h:12
NT unit_part(const NT &x)
The function unit_part() computes the unit part of a given ring element.
result_type sign(const NT &x)
The template function sign() returns the sign of its argument.
Tag indicating that a type is a model of the Field concept.
Definition: Algebraic_structure_traits.h:48
Tag indicating that a type is a model of the IntegralDomainWithoutDivision concept.
Definition: Algebraic_structure_traits.h:127