carl  24.04
Computer ARithmetic Library
typetraits.h
Go to the documentation of this file.
1 /*
2  * File: typetraits.h
3  * Author: stefan
4  *
5  * Created on August 28, 2014, 11:25 AM
6  */
7 
8 #pragma once
9 
10 #ifndef INCLUDED_FROM_NUMBERS_H
11 static_assert(false, "This file may only be included indirectly by numbers.h");
12 #endif
13 
14 namespace carl
15 {
16  template<typename F>
17  class FLOAT_T;
18 
19  template<typename F>
20  struct IntegralType<carl::FLOAT_T<F> >
21  {
22  #ifdef USE_CLN_NUMBERS
23  using type = cln::cl_I;
24  #else
25  using type = mpz_class;
26  #endif
27  };
28 
29  template<typename C>
30  struct is_rational_type<FLOAT_T<C>>: std::integral_constant<bool, is_rational_type<C>::value>
31  {};
32 
33  template<typename C>
34  struct is_float_type<carl::FLOAT_T<C>> : std::true_type
35  {};
36 
37  #ifdef USE_MPFR_FLOAT
38  template<>
39  struct is_float_type<mpfr_t> : std::true_type
40  {};
41  #endif
42 }
States if a type is a floating point type.
Definition: typetraits.h:177
carl is the main namespace for the library.
Templated wrapper class which allows universal usage of different IEEE 754 implementations.
Definition: FLOAT_T.h:114
States if a type is a rational type.
Definition: typetraits.h:269
Gives the corresponding integral type.
Definition: typetraits.h:310