17 template <
class C>
struct CST {
25 template <
class C>
inline void convert (C &,
char *);
26 template <
class C>
inline bool IsNull (
const C);
27 template <
class C>
inline bool IsDivide (
const C,
const C);
28 template <
class C>
inline C
Gcd (
const C,
const C);
34 template <
class C>
inline bool IsNull(
const C
c) {
50 template <>
inline bool IsNull(
const int i) {
56 return b != 0 && a % b == 0;
60 inline int Gcd (
int a,
int b) {
62 while ((r = a % b) != 0)
73 for (
int i = n;
i > 1; --
i)
98 for(;(tmp/comp)>(T)1;i++) comp*=10;
101 if (strchr(s,
'.')!=NULL)
109 case '1':{tmp+=sign*1/comp;comp*=10;
break;}
110 case '2':{tmp+=sign*2/comp;comp*=10;
break;}
111 case '3':{tmp+=sign*3/comp;comp*=10;
break;}
112 case '4':{tmp+=sign*4/comp;comp*=10;
break;}
113 case '5':{tmp+=sign*5/comp;comp*=10;
break;}
114 case '6':{tmp+=sign*6/comp;comp*=10;
break;}
115 case '7':{tmp+=sign*7/comp;comp*=10;
break;}
116 case '8':{tmp+=sign*8/comp;comp*=10;
break;}
117 case '9':{tmp+=sign*9/comp;comp*=10;
break;}
128 reslook=strchr(s,
'e');
131 comp=atoi(reslook+1);
132 for (
int k=0;(T)
k<comp;
k++)
134 for (
int k=0;(T)
k>comp;
k--)
141 template <>
inline bool IsNull(
const double d) {
150 double Gcd (
double a,
double b) {
154 #endif // //_Arith_H_
bool IsNull(const C)
Generic equality test to zero.
Definition: Arith.hpp:34
Definition of constants.
Definition: Arith.hpp:17
int sign(const Scl< T > &b)
Definition: BC.hpp:307
MSKint32t k
Definition: mosek.h:2713
void convert(C &, char *)
static const C Zero
Definition: Arith.hpp:18
bool IsDivide(const C, const C)
static const C Un
Definition: Arith.hpp:19
MSKrealt * c
Definition: mosek.h:2678
MSKint32t MSKint32t MSKint32t i
Definition: mosek.h:2278
MSKrescodee r
Definition: mosek.h:2321
MSKstreamtypee MSKint32t MSKint32t MSKint32t MSKint32t MSKint32t MSKint32t MSKint32t MSKint32t MSKint32t a
Definition: mosek.h:3833
double factorial(int n)
Definition: Arith.hpp:71