carl  24.04
Computer ARithmetic Library
operations_predeclarations.h
Go to the documentation of this file.
1 #pragma once
2 
3 #ifndef INCLUDED_FROM_NUMBERS_H
4 static_assert(false, "This file may only be included indirectly by numbers.h");
5 #endif
6 
8 #include <string>
9 
10 namespace carl {
11 
12  template<typename T>
13  inline T rationalize(double n);
14 
15  template<typename T>
16  inline T rationalize(float n);
17 
18  template<typename T>
19  inline T rationalize(int n);
20 
21  template<typename T>
22  inline T rationalize(sint n);
23 
24  template<typename T>
25  inline T rationalize(uint n);
26 
27 
28  template<typename From, typename To, carl::DisableIf< std::is_same<From,To> > = dummy >
29  inline To convert(const From&);
30 
31  template<typename From, typename To, carl::EnableIf< std::is_same<From,To> > = dummy >
32  inline To convert(const From& n);
33 
34  template<typename Number>
35  inline int to_int(const Number& n);
36 
37  template<typename T>
38  inline T parse(const std::string& n);
39 
40  template<typename T>
41  inline bool try_parse(const std::string& n, T& res);
42 }
carl is the main namespace for the library.
T rationalize(const PreventConversion< mpq_class > &)
std::uint64_t uint
Definition: numbers.h:16
Integer to_int(const Interval< Number > &_floatInterval)
Casts the Interval to an arbitrary integer type which has a constructor for a native int.
Definition: Interval.h:1500
T parse(const std::string &n)
bool try_parse(const std::string &n, T &res)
BasicConstraint< ToPoly > convert(const typename ToPoly::ContextType &context, const BasicConstraint< FromPoly > &c)
Definition: Conversion.h:9
std::int64_t sint
Definition: numbers.h:17