Next: Bit Operations
Up: Rational (rational.h)
Previous: Basic Operations
- Addition (both arguments of the same type):
| Algorithm: |
|
c := a+b |
| Input: |
|
. |
| Output: |
|
such that  |
| Algorithm: |
|
c := c += a |
| Input: |
|
. |
| Output: |
|
such that  |
| Algorithm: |
|
c := ++a |
| Input: |
|
. |
| Output: |
|
such that  |
| Algorithm: |
|
c := a++ |
| Input: |
|
. |
| Output: |
|
such that  |
- Subtraction (both arguments of the same type):
| Algorithm: |
|
c := a-b |
| Input: |
|
. |
| Output: |
|
such that  |
| Algorithm: |
|
c := c -= a |
| Input: |
|
. |
| Output: |
|
such that  |
| Algorithm: |
|
c := -a |
| Input: |
|
. |
| Output: |
|
such that  |
| Algorithm: |
|
c := a- |
| Input: |
|
. |
| Output: |
|
such that  |
| Algorithm: |
|
c := -a |
| Input: |
|
. |
| Output: |
|
such that  |
- Multiplication (both arguments of the same type):
| Algorithm: |
|
c := a*b |
| Input: |
|
. |
| Output: |
|
such that  |
| Algorithm: |
|
c := c *= a |
| Input: |
|
. |
| Output: |
|
such that  |
- Division (both arguments of the same type):
| Algorithm: |
|
c := a/b |
| Input: |
|
. |
| Output: |
|
such that  |
| Algorithm: |
|
c := c /= a |
| Input: |
|
. |
| Output: |
|
such that  |
Next: Bit Operations
Up: Rational (rational.h)
Previous: Basic Operations
Piologie Version 1.2
3/3/1998