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: 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: References: From: Ian Kelly Date: Thu, 21 Feb 2013 17:19:05 -0700 Subject: Re: Confusing math problem To: Python 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: 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 On Thu, Feb 21, 2013 at 4:41 PM, Schizoid Man 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.