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


Groups > comp.lang.python > #39502

Re: Confusing math problem

Path csiph.com!usenet.pasdenom.info!goblin1!goblin.stu.neva.ru!uio.no!news.tele.dk!news.tele.dk!small.news.tele.dk!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <ian.g.kelly@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.028
X-Spam-Evidence '*H*': 0.94; '*S*': 0.00; '21,': 0.07; 'wrapper': 0.07; 'arguments,': 0.09; 'library': 0.15; 'integers.': 0.16; 'wrote:': 0.17; 'thu,': 0.17; 'feb': 0.19; 'equivalent': 0.20; 'latter': 0.22; 'subject:problem': 0.22; 'header:In-Reply-To:1': 0.25; 'message-id:@mail.gmail.com': 0.27; 'arguments.': 0.29; 'restricted': 0.29; 'function': 0.30; 'function.': 0.33; 'to:addr :python-list': 0.33; 'version': 0.34; 'received:google.com': 0.34; 'built-in': 0.35; 'pm,': 0.35; 'received:209.85': 0.35; 'but': 0.36; 'received:209': 0.37; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; 'takes': 0.39; 'different': 0.63; 'more': 0.63; '2013': 0.84; 'to:name:python': 0.84
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:in-reply-to:references:from:date:message-id :subject:to:content-type; bh=IPUcu68mWKVQGYo23I2KTgHA0W7uzvZDFHElCrqd6cY=; b=l8pjKdhSUjapu6LbgR7CXGONo0j1KCI+LdlFJB0ZOYc/kGV0hXqnQP4M2iytfSgDGN E4addNJRhxxMSoqa47dEGyKH3pmtt0uc1lxL6XPGIXO2MJmMcnrf6y4u08P0v2lNZulQ 5RrFaal1BJg6sBEZ7MUyz6DfMvXxIBMD94yMSfbopxfmjoJaDagc31YPCogKbmhnlnZb kz7Q6a7+34EzfCnTMfeMCt6neRsGPDnrfEc/feqZ6W5xsg5US+HFaRKgyhJqmNcc05yD FihuxyfTlbePmzKCs0jl9zk9pMPu2ATxltlUMem7Nb2Q/0WvB4+w8nB2AxM1W9IpKBXP M1gw==
X-Received by 10.59.11.67 with SMTP id eg3mr35001617ved.31.1361492386006; Thu, 21 Feb 2013 16:19:46 -0800 (PST)
MIME-Version 1.0
In-Reply-To <kg6b9d$sj2$1@dont-email.me>
References <kg5sog$lfb$1@dont-email.me> <mailman.2191.1361478337.2939.python-list@python.org> <kg67l7$bm8$1@dont-email.me> <mailman.2209.1361487258.2939.python-list@python.org> <kg6b9d$sj2$1@dont-email.me>
From Ian Kelly <ian.g.kelly@gmail.com>
Date Thu, 21 Feb 2013 17:19:05 -0700
Subject Re: Confusing math problem
To Python <python-list@python.org>
Content-Type text/plain; charset=ISO-8859-1
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 <http://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 <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.2223.1361492389.2939.python-list@python.org> (permalink)
Lines 12
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1361492389 news.xs4all.nl 6961 [2001:888:2000:d::a6]:59009
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:39502

Show key headers only | View raw


On Thu, Feb 21, 2013 at 4:41 PM, Schizoid Man <schiz_man@21stcentury.com> wrote:
> So how is operator.pow() different from just pow()?

math.pow() is a wrapper around the C library function.

** and operator.pow() are the same thing; the latter is just a
function version of the former.

The built-in pow() is a mutant version that takes either 2 or 3
arguments.  With 2 arguments, pow(a, b) is again equivalent to a ** b.
 With 3 arguments, pow(a, b, c) is equivalent to but more efficient
than a ** b % c, but a and b are restricted to integers.

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


Thread

Confusing math problem "Schizoid Man" <schiz_man@21stcentury.com> - 2013-02-21 19:33 +0000
  Re: Confusing math problem Dave Angel <davea@davea.name> - 2013-02-21 15:25 -0500
    Re: Confusing math problem "Schizoid Man" <schiz_man@21stcentury.com> - 2013-02-21 22:39 +0000
      Re: Confusing math problem Oscar Benjamin <oscar.j.benjamin@gmail.com> - 2013-02-21 22:53 +0000
        Re: Confusing math problem "Schizoid Man" <schiz_man@21stcentury.com> - 2013-02-21 23:41 +0000
          Re: Confusing math problem Oscar Benjamin <oscar.j.benjamin@gmail.com> - 2013-02-22 00:04 +0000
          Re: Confusing math problem Ian Kelly <ian.g.kelly@gmail.com> - 2013-02-21 17:19 -0700
    Re: Confusing math problem "Schizoid Man" <schiz_man@21stcentury.com> - 2013-02-21 23:39 +0000
  Re: Confusing math problem Ian Kelly <ian.g.kelly@gmail.com> - 2013-02-21 13:42 -0700
  Re: Confusing math problem Chris Angelico <rosuav@gmail.com> - 2013-02-22 07:46 +1100
    Re: Confusing math problem "Schizoid Man" <schiz_man@21stcentury.com> - 2013-02-21 22:44 +0000
      Re: Confusing math problem Chris Angelico <rosuav@gmail.com> - 2013-02-22 11:29 +1100
      Re: Confusing math problem Dave Angel <davea@davea.name> - 2013-02-21 21:19 -0500
  Re: Confusing math problem Dave Angel <davea@davea.name> - 2013-02-21 15:49 -0500
  Re: Confusing math problem Chris Angelico <rosuav@gmail.com> - 2013-02-22 08:23 +1100
    Re: Confusing math problem Peter Pearson <ppearson@nowhere.invalid> - 2013-02-21 21:59 +0000
      Re: Confusing math problem Chris Angelico <rosuav@gmail.com> - 2013-02-22 09:11 +1100
      Re: Confusing math problem Dave Angel <davea@davea.name> - 2013-02-21 17:33 -0500
      Re: Confusing math problem Chris Angelico <rosuav@gmail.com> - 2013-02-22 10:15 +1100
    Re: Confusing math problem Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-02-22 09:16 +0000
      Re: Confusing math problem Serhiy Storchaka <storchaka@gmail.com> - 2013-02-22 13:48 +0200
  Re: Confusing math problem Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-02-22 09:27 +0000

csiph-web