Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #78295

Re: GCD in Fractions

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.003
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'explicitly': 0.05; 'definitions': 0.07; 'agrees': 0.09; 'integers': 0.09; "people's": 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'suggest': 0.14; 'complaining': 0.16; 'for,': 0.16; 'from:addr:behnel.de': 0.16; 'from:addr:stefan_ml': 0.16; 'from:name:stefan behnel': 0.16; 'here).': 0.16; 'other)': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'situation.': 0.16; 'sources,': 0.16; 'fix': 0.17; 'wrote:': 0.18; 'code.': 0.18; 'library': 0.18; 'looked': 0.18; 'ticket': 0.19; 'everyone,': 0.19; 'stefan': 0.19; 'foundation': 0.20; 'header:User-Agent:1': 0.23; 'mathematical': 0.24; 'decide': 0.24; 'question': 0.24; 'references': 0.26; 'tracker': 0.26; 'somewhere': 0.26; 'defined': 0.27; 'header:X-Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'breaking': 0.31; "d'aprano": 0.31; 'steven': 0.31; 'anyone': 0.31; 'open': 0.33; 'says': 0.33; 'sources': 0.33; 'actual': 0.34; 'problem': 0.35; 'common': 0.35; 'definition': 0.35; 'equal': 0.35; 'received:84': 0.35; 'but': 0.35; 'add': 0.35; 'there': 0.35; 'really': 0.36; 'raising': 0.36; 'should': 0.36; 'changing': 0.37; 'so,': 0.37; 'two': 0.37; 'being': 0.38; 'generic': 0.38; 'on-line': 0.38; 'to:addr:python-list': 0.38; 'issue': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'university': 0.39; 'received:org': 0.40; 'how': 0.40; 'even': 0.60; 'greatest': 0.60; 'ground': 0.60; 'negative': 0.60; 'hope': 0.61; 'new': 0.61; 'numbers': 0.61; 'back': 0.62; 'name': 0.63; 'such': 0.63; 'visit': 0.64; 'more': 0.64; 'shortly': 0.68; 'conflicts': 0.84; 'mathematica': 0.84; 'standing': 0.84
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Stefan Behnel <stefan_ml@behnel.de>
Subject Re: GCD in Fractions
Date Wed, 24 Sep 2014 18:13:23 +0200
References <pfGdnaNKbb7-sbzJnZ2dnUVZ8vudnZ2d@brightview.co.uk> <54216c8e$0$29966$c3e8da3$5496439d@news.astraweb.com> <lvs7lq$vrn$1@ger.gmane.org> <mailman.14277.1411493200.18130.python-list@python.org> <CYmdneCJKbm7LLzJnZ2dnUVZ7vadnZ2d@brightview.co.uk> <mailman.14280.1411494972.18130.python-list@python.org> <tfidne0ioO6jdbzJnZ2dnUVZ7rednZ2d@brightview.co.uk> <5422ae8b$0$29980$c3e8da3$5496439d@news.astraweb.com> <WdGdnY7uu9nKW7_JnZ2dnUVZ7omdnZ2d@brightview.co.uk>
Mime-Version 1.0
Content-Type text/plain; charset=utf-8
Content-Transfer-Encoding 7bit
X-Gmane-NNTP-Posting-Host dslb-084-056-048-104.084.056.pools.vodafone-ip.de
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.1
In-Reply-To <WdGdnY7uu9nKW7_JnZ2dnUVZ7omdnZ2d@brightview.co.uk>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.14320.1411575221.18130.python-list@python.org> (permalink)
Lines 42
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1411575221 news.xs4all.nl 2913 [2001:888:2000:d::a6]:59933
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:78295

Show key headers only | View raw


blindanagram schrieb am 24.09.2014 um 15:25:
> On 24/09/2014 12:44, Steven D'Aprano wrote:
> 
>> blindanagram wrote:
> [snip]
>> - Mathworld says that GCD of two negative numbers is a negative number;
>>
>> - but Mathematica says that GCD of two negative numbers is a positive;
>>
>> - Wikipedia agrees with Mathematica and disagrees with Mathworld;
> 
> After looking at these (and several other) on-line mathematical sites, I
> realised that I would have to go back to long standing mathemmatical
> references to find how the gcd is defined by those that explicitly cover
> the greatest common divisor for negative integers (I did this before
> raising the issue here).
> 
> All four that I have so far looked at have definitions that lead to
> gcd(a, b) for integers being equal to gcd(|a|, |b|). I hope to visit a
> University library shortly to review more.  Does anyone know of such a
> reference that uses a definition that conflicts with gcd(a, b) for
> integers being equal to gcd(|a|, |b|)?

Steven has already given sources that suggest that the result of gcd()
should be positive. Just like he gave sources that suggest the opposite.
So, the question is not how or where to find even more sources, or to
decide which of those sources is "more right" than the others, the question
is whether such a shaky ground is a reasonable foundation for breaking
other people's code.

We have an open tracker ticket now on changing *something* about the
current situation. Let's just add some new functionality somewhere if
people really want it (as in "need it for their code", not just "want it
for purity reasons" or "sleep better when they know it's out there"), but
please, everyone, stop complaining about "fractions.gcd" not catering for
your needs. It does what it's there for, even if the name is more public or
more generic than you might want. There are other ways to fix the actual
problem and move on.

Stefan

Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

GCD in Fractions blindanagram <noone@nowhere.net> - 2014-09-23 09:16 +0100
  Re: GCD in Fractions Wolfgang Maier <wolfgang.maier@biologie.uni-freiburg.de> - 2014-09-23 13:53 +0200
    Re: GCD in Fractions blindanagram <noone@nowhere.net> - 2014-09-23 13:48 +0100
  Re: GCD in Fractions Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-09-23 22:50 +1000
    Re: GCD in Fractions blindanagram <noone@nowhere.net> - 2014-09-23 15:37 +0100
      Re: GCD in Fractions Chris Angelico <rosuav@gmail.com> - 2014-09-24 00:42 +1000
    Re: GCD in Fractions Wolfgang Maier <wolfgang.maier@biologie.uni-freiburg.de> - 2014-09-23 18:38 +0200
    Re: GCD in Fractions Ian Kelly <ian.g.kelly@gmail.com> - 2014-09-23 11:20 -0600
      Re: GCD in Fractions blindanagram <noone@nowhere.net> - 2014-09-23 18:31 +0100
    Re: GCD in Fractions Stefan Behnel <stefan_ml@behnel.de> - 2014-09-23 19:26 +0200
      Re: GCD in Fractions blindanagram <noone@nowhere.net> - 2014-09-23 18:43 +0100
        Re: GCD in Fractions Stefan Behnel <stefan_ml@behnel.de> - 2014-09-23 19:55 +0200
          Re: GCD in Fractions blindanagram <noone@nowhere.net> - 2014-09-23 22:38 +0100
            Re: GCD in Fractions Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-09-24 21:44 +1000
              Re: GCD in Fractions blindanagram <noone@nowhere.net> - 2014-09-24 14:25 +0100
                Re: GCD in Fractions Stefan Behnel <stefan_ml@behnel.de> - 2014-09-24 18:13 +0200
                Re: GCD in Fractions blindanagram <noone@nowhere.net> - 2014-09-24 18:05 +0100
                Re: GCD in Fractions "Robert E. Beaudoin" <rbeaudoin@comcast.net> - 2014-09-24 19:19 -0400
              Re: GCD in Fractions Ian Kelly <ian.g.kelly@gmail.com> - 2014-09-24 08:26 -0600
              Re: GCD in Fractions random832@fastmail.us - 2014-09-24 12:49 -0400
              Re: GCD in Fractions Terry Reedy <tjreedy@udel.edu> - 2014-09-24 13:42 -0400
              Re: GCD in Fractions Johann Hibschman <jhibschman@gmail.com> - 2014-09-24 14:09 -0400
        Re: GCD in Fractions Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-09-23 20:30 +0100
          Re: GCD in Fractions blindanagram <noone@nowhere.net> - 2014-09-23 22:48 +0100
            Re: GCD in Fractions Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-09-23 23:52 +0100
            Re: GCD in Fractions Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-09-24 11:42 +0100
            Re: GCD in Fractions Mark Dickinson <mdickinson@enthought.com> - 2014-09-24 11:14 +0000
            Re: GCD in Fractions Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-09-24 17:34 +0100
              Re: GCD in Fractions blindanagram <noone@nowhere.net> - 2014-09-24 18:31 +0100
            Re: GCD in Fractions Akira Li <4kir4.1i@gmail.com> - 2014-09-25 14:56 +0400
            Re: GCD in Fractions Chris Angelico <rosuav@gmail.com> - 2014-09-25 21:03 +1000
    Re: GCD in Fractions Ian Kelly <ian.g.kelly@gmail.com> - 2014-09-23 11:39 -0600
    Re: GCD in Fractions Ian Kelly <ian.g.kelly@gmail.com> - 2014-09-23 11:40 -0600
    Re: GCD in Fractions Stefan Behnel <stefan_ml@behnel.de> - 2014-09-23 20:09 +0200
  Re: GCD in Fractions Terry Reedy <tjreedy@udel.edu> - 2014-09-23 15:31 -0400

csiph-web