![]() |
Python_2
1.0
|
A very simple fraction class. More...
Classes | |
class | Fracao |
A simple class for creating fraction objects (rational numbers). More... | |
Functions | |
def | mdc (x, y) |
mdc is a general use function, defined outside the class. More... | |
def | main () |
Main program for testing. More... | |
A very simple fraction class.
In the future, Python will switch to always yielding a real result, and to force an integer division operation, you use the special "//" integer division operator. If you want that behavior now, just import that "from the future":
def _01a_fracao.main | ( | ) |
Main program for testing.
def _01a_fracao.mdc | ( | x, | |
y | |||
) |
mdc is a general use function, defined outside the class.
x | first integer: numerator. |
y | second integer: denominator. |
Greatest Common Divisor (Maximo divisor comum).
Referenced by _01a_fracao.Fracao.simplifica().