Go to the source code of this file.
|
Rational | operator- (const Rational &r) |
|
bool | operator< (const Rational &a, const Rational &b) |
|
bool | operator<= (const Rational &a, const Rational &b) |
|
bool | operator> (const Rational &a, const Rational &b) |
|
bool | operator>= (const Rational &a, const Rational &b) |
|
bool | operator== (const Rational &a, const Rational &b) |
|
bool | operator!= (const Rational &a, const Rational &b) |
|
Rational | operator+ (const Rational &a, const Rational &b) |
|
Rational | operator- (const Rational &a, const Rational &b) |
|
Rational | operator* (const Rational &a, const Rational &b) |
|
Rational | pow (const Rational &a, int e) |
|
Rational | operator/ (const Rational &a, const Rational &b) |
|
int | sgn (const Rational &a) |
|
Rational | abs (const Rational &a) |
|
Rational | gcd (const Rational &a, const Rational &b) |
|
Rational | gcd (Rational *a, int n) |
|
Rational | lcm (const Rational &a, const Rational &b) |
|
Rational | lcm (Rational *a, int n) |
|
◆ GMPRAT_CC
◆ abs()
◆ gcd() [1/2]
Definition at line 448 of file GMPrat.cc.
449{
450 if( a == 0 )
451 {
453 {
455 }
456 else
457 {
459 }
460 }
462 {
464 }
465
467
472
473
474
476}
Rational abs(const Rational &a)
◆ gcd() [2/2]
Definition at line 478 of file GMPrat.cc.
479{
480 if( n == 1 )
481 {
482 return a[0];
483 }
484
486
487 for(
int i=2;
i<n;
i++ )
488 {
490 }
491
493}
Rational gcd(const Rational &a, const Rational &b)
◆ lcm() [1/2]
Definition at line 495 of file GMPrat.cc.
496{
497 if( a == 0 )
498 {
500 }
502 {
503 return a;
504 }
505
507}
◆ lcm() [2/2]
Definition at line 509 of file GMPrat.cc.
510{
511 if( n == 1 )
512 {
513 return a[0];
514 }
515
517
518 for(
int i=2;
i<n;
i++ )
519 {
521 }
522
524}
Rational lcm(const Rational &a, const Rational &b)
◆ operator!=()
Definition at line 318 of file GMPrat.cc.
319{
321 return true;
322}
◆ operator*()
◆ operator+()
◆ operator-() [1/2]
◆ operator-() [2/2]
◆ operator/()
◆ operator<()
Definition at line 288 of file GMPrat.cc.
289{
291 return false;
292}
◆ operator<=()
Definition at line 294 of file GMPrat.cc.
295{
297 return true;
298}
◆ operator==()
Definition at line 312 of file GMPrat.cc.
313{
315 return false;
316}
◆ operator>()
Definition at line 300 of file GMPrat.cc.
301{
303 return false;
304}
◆ operator>=()
Definition at line 306 of file GMPrat.cc.
307{
309 return true;
310}
◆ pow()
Definition at line 411 of file GMPrat.cc.
412{
414
415 for(
int i=0;
i<e;
i++ )
416 {
418 }
420}
◆ sgn()