Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eUv49-0005hW-Qm for pgsql-committers@arkaria.postgresql.org; Fri, 29 Dec 2017 13:51:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eUv49-0007m1-9B for pgsql-committers@arkaria.postgresql.org; Fri, 29 Dec 2017 13:51:17 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eUv49-0007lr-0B for pgsql-committers@lists.postgresql.org; Fri, 29 Dec 2017 13:51:17 +0000 Received: from mail-yb0-x243.google.com ([2607:f8b0:4002:c09::243]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1eUv45-0003Nw-JB for pgsql-committers@postgresql.org; Fri, 29 Dec 2017 13:51:16 +0000 Received: by mail-yb0-x243.google.com with SMTP id k189so1285415ybc.12 for ; Fri, 29 Dec 2017 05:51:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=from:subject:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=fiGqeXssJ69ifQiJVapPH8ifHtkZGHV7gTxUDwZmYJ8=; b=YJjxV50hzDGiqfhuuxbgNds+CTc2Xmeqrpcrx4iC3kyBsw5i3tyFniRhoSCGbY6ETF ez5/k3VQ6ugBHzFSK1TQgUVNc5ipcjkmvm4N8Pqa+5PmKM1G46pphG8N7A7nKOB6zOgi ZjlqqlMTdu+S0BJC2GwSgtR0KxO+WETLSjc0UDxHEP4f/PJFHKhfd/TUw8thilT8k/ko vc2HK+OOoW46dgr4cdPa7hAW5C0vnZkKDPYRlgSLijxZgGjIW9Hf5dS0z64fU+7XXY58 Yf7MKwjwKouSMdlFZPX4BYxzL5SNjxMP4ccsn3V1V8O0aM27RH0GrQv4sC8jiYRd9c5d YVYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=fiGqeXssJ69ifQiJVapPH8ifHtkZGHV7gTxUDwZmYJ8=; b=puad0Uov93qpdLMZWX1sGRWUVpRtjGpjuNFvnp+2rS09CeBy99ueqOeOttAj1+Xb2k 2lOXgv9vGZst0RysUIYzyJ0unBUK30dUYtgdenmGpeFJCFddB1IV0XoGfUH1jPrOtrRp 2wBYkbrGkWUMYv50hGB2VIaaxZZvcqpNgNbD1WmZ8Bo1XWCtpOAnnGcISO26+wKkAhdZ BvnBRPNKtoV6Gy87/vbLSnByCPmJlYtWLFPGsNsRPi9E7fwz4uAFzPxg3epaMoDrlSuc NxYnzM3XLzdilt/08LlK6paD/Sri218xkeH9YKXW/xeGTHE0vnzgrX6SdXzmcQV69p6U J9kA== X-Gm-Message-State: AKGB3mIFL7Dkberl5m6cojaW0qP+P1IK1X24J5cQquxLKKcz5+SyUALN 85d6duDyIKSCg/XDFV1RU7smzviTzwaFyvLg40oeO1krp0YyeCsK78YqVMVh9J9cqxJXID7Zi0M KKNnF62aq3fN7YUtwwxsZVq0BYZpCYN7pHkJfZNqeMe9cZNfsZyChnREpy0bQl0qBp5I1q200hC 1OKVrXyR1rrpc0uLiA X-Google-Smtp-Source: ACJfBouBXrYXF2wFa7JnKkxWAFCEffqFFoH1M9hIrHZKHENzk5fvcsCQfQ3a7phj9RTKlAGyNk+4NQ== X-Received: by 10.37.208.84 with SMTP id h81mr24964721ybg.13.1514555471458; Fri, 29 Dec 2017 05:51:11 -0800 (PST) Received: from [192.168.10.146] ([98.122.175.38]) by smtp.gmail.com with ESMTPSA id g123sm16483363ywd.48.2017.12.29.05.51.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 29 Dec 2017 05:51:11 -0800 (PST) From: Andrew Dunstan X-Google-Original-From: Andrew Dunstan Subject: Re: pgsql: Add pow(), aka power(), function to pgbench. To: =?UTF-8?B?UmHDumwgTWFyw61uIFJvZHLDrWd1ZXo=?= , Fabien COELHO Cc: Thomas Munro , Robert Haas , pgsql-committers References: Message-ID: <6a65f141-d1e2-d30b-397a-57fffedd2965@2ndQuadrant.com> Date: Fri, 29 Dec 2017 08:51:10 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Content-Language: en-MW List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 12/29/2017 08:04 AM, Raúl Marín Rodríguez wrote: > > Probably "0?". Although an int with leading zeros is usually an > octal number, so window's rational fails me. > > > You are right. From the C99 standard: > > The exponent always contains at least two digits, and only as many > more digits as necessary to represent the exponent. If the value > is zero, the exponent is zero. > > >  Both solutions seem fine to me. Also, as these couple of tests were > added to check for int overflow and we no longer do any int > operations, removing them wouldn't be a big loss.  > -- > *Raúl Marín Rodríguez  > *carto.com > 0? seems right. I have committed that. cheers andrew -- Andrew Dunstan https://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services