~ubuntu-branches/ubuntu/karmic/python3.0/karmic

« back to all changes in this revision

Viewing changes to Doc/library/fractions.rst

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2009-02-16 17:18:23 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20090216171823-1d5cm5qnnjvmnzzm
Tags: 3.0.1-0ubuntu1
New upstream version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
   :exc:`ZeroDivisionError`. The second version requires that
26
26
   *other_fraction* is an instance of :class:`numbers.Rational` and
27
27
   returns an :class:`Fraction` instance with the same value.  The
28
 
   last version of the constructor expects a string or unicode
 
28
   last version of the constructor expects a string
29
29
   instance in one of two possible forms.  The first form is::
30
30
 
31
31
      [sign] numerator ['/' denominator]
126
126
 
127
127
.. function:: gcd(a, b)
128
128
 
129
 
   Return the greatest common divisor of the integers `a` and `b`.  If
130
 
   either `a` or `b` is nonzero, then the absolute value of `gcd(a,
131
 
   b)` is the largest integer that divides both `a` and `b`.  `gcd(a,b)`
132
 
   has the same sign as `b` if `b` is nonzero; otherwise it takes the sign
133
 
   of `a`.  `gcd(0, 0)` returns `0`.
 
129
   Return the greatest common divisor of the integers *a* and *b*.  If either
 
130
   *a* or *b* is nonzero, then the absolute value of ``gcd(a, b)`` is the
 
131
   largest integer that divides both *a* and *b*.  ``gcd(a,b)`` has the same
 
132
   sign as *b* if *b* is nonzero; otherwise it takes the sign of *a*.  ``gcd(0,
 
133
   0)`` returns ``0``.
134
134
 
135
135
 
136
136
.. seealso::