Changeset 7bf4b7 in git for kernel/GMPrat.cc
 Timestamp:
 Feb 18, 2010, 12:18:19 PM (13 years ago)
 Branches:
 (u'jengelhdatetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
 Children:
 e5af4f0868c1101450c507a01d0cc4909e954fcb
 Parents:
 cd2d901a045b1d74d20f86f668a4b0e1e3e54de8
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

kernel/GMPrat.cc
rcd2d90 r7bf4b7 64 64 { 65 65 p = new rep; 66 mpq_init( p>rat ); 67 mpq_set_si( p>rat,(long int)a,1 ); 66 mpq_init_set_si( p>rat,(long)a,1 ); 68 67 } 69 68 … … 89 88 if (b<0) a=a; 90 89 p=new rep; 91 mpq_init(p>rat); 92 mpq_set_si(p>rat,(long int) a,(unsigned long int) abs(b)); 90 mpq_init_set_si(p>rat,(long) a,(unsigned long) abs(b)); 93 91 mpq_canonicalize(p>rat); 94 92 } … … 100 98 Rational::~Rational() 101 99 { 102 if (p>n==0){ 100 if ((p>n)==0) 101 { 103 102 mpq_clear(p>rat); 104 103 delete p; … … 113 112 { 114 113 disconnect(); 115 mpq_set_si(p>rat,(long int) a,1);114 mpq_set_si(p>rat,(long) a,1); 116 115 return *this; 117 116 } … … 120 119 { 121 120 a.p>n++; 122 if (p>n==0){ 121 if ((p>n)==0) 122 { 123 123 mpq_clear(p>rat); 124 124 delete p; … … 166 166 Rational::operator int() 167 167 { 168 mpz_t 169 h; 170 long int 171 ret_val; 168 mpz_t h; 169 long ret_val; 172 170 173 171 mpz_init(h); … … 186 184 Rational::operator() 187 185 { 188 Rational 189 erg; 186 Rational erg; 190 187 191 188 mpq_neg(erg.p>rat,p>rat); … … 195 192 Rational operator  ( const Rational &r ) 196 193 { 197 Rational 198 erg; 194 Rational erg; 199 195 200 196 mpq_neg(erg.p>rat,r.p>rat); … … 209 205 Rational::operator~() 210 206 { 211 Rational 212 erg; 207 Rational erg; 213 208 214 209 mpq_inv(erg.p>rat,p>rat); … … 272 267 Rational::operator++(int) 273 268 { 274 Rational 275 erg(*this); 269 Rational erg(*this); 276 270 277 271 mpq_set(save.p>rat,p>rat); … … 293 287 Rational::operator(int) 294 288 { 295 Rational 296 erg(*this); 289 Rational erg(*this); 297 290 298 291 mpq_set(save.p>rat,p>rat);
Note: See TracChangeset
for help on using the changeset viewer.