Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oj0xB-00082Z-8n for pgsql-general@arkaria.postgresql.org; Thu, 13 Oct 2022 16:21:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oj0xA-00059o-5R for pgsql-general@arkaria.postgresql.org; Thu, 13 Oct 2022 16:21:00 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oj0x8-000580-L4 for pgsql-general@lists.postgresql.org; Thu, 13 Oct 2022 16:20:59 +0000 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oj0x5-0007Td-It for pgsql-general@postgresql.org; Thu, 13 Oct 2022 16:20:57 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id B556E3200392 for ; Thu, 13 Oct 2022 12:20:53 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Thu, 13 Oct 2022 12:20:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:message-id:mime-version:reply-to:sender:subject :subject:to:to; s=fm2; t=1665678053; x=1665764453; bh=nTFsglp5jE sA4Bet59ujasgGP2tU094zyfz2boL92gQ=; b=qnG4NUEtrHjE3UUzuaBCZCfxA1 pprpf6yj+siS30CYyS9Mv9W4x0ONfTE3iPAs3ZeldUI0vxrTAoHUnC15S6MDb3Gn sWHMwbdDZOOkgqxZrfsWTf6hQSnN9eWjlgTtb4qOirUcXJtG1Ji5eT3N/ns+AJkD EnVRenrV6NnOvZOE4OqpCgC9YlbplAV66Yc+HgSCHvUcj+yQ7Vz8l2veDS0cjc5H /oepJeaA59VH73aqOLA9PD0to95+uXz/Slw5qi9EJ2xi4LsvvoZ1SI988BBfFbSf ZEZJRIlVItVPLAJ3cg8VQhTOJqM5cdQp1vfe8CDMzoJBVe4ZdsmIdXZzd6sA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:date:feedback-id:feedback-id:from:from:in-reply-to :message-id:mime-version:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; t=1665678053; x=1665764453; bh=nTFsglp5jEsA4Bet59ujasgGP2tU 094zyfz2boL92gQ=; b=mC4gGwuLThgOx/nwGJizBzxOOm0MMfpiRzslByUMVSAb 3PNp1MfWQLy2S3qrIviblJyEVCjAC9nBHYX7iRSSuvizeJuer6tfo1hXWHHMaX6z 209VKvEQv7DylUw8Gz78sxg/JBa/yqTB7YHED1zADbBJAiuAnr98Z0WjPSe0GqAJ 5eDJ6pMGo96qdtESYn9FkjGNknV0U5/1OseBuxid+2TW3047VOnTblalu8U3EoX9 6zLqV6QukcGpQ/HPP54FD+hFYZbRb+uE1K2Ij65X8tyxKzJqY8sCGS29t5G3IKQE j0vt4YirCiGICekzS44oyvF8Qn/4oaT7K3GuYZNIOQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfeektddguddtvdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhepkfffgggfvffhufgtgfesthejre dttdefjeenucfhrhhomheptegurhhirghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhl rghvvghrsegrkhhlrghvvghrrdgtohhmqeenucggtffrrghtthgvrhhnpeejgefgjeekje evvedtkedvudffveehjeetjeetgfffvdffvedtvdekhefftefgfeenucevlhhushhtvghr ufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrughrihgrnhdrkhhlrghvvg hrsegrkhhlrghvvghrrdgtohhm X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Thu, 13 Oct 2022 12:20:52 -0400 (EDT) Message-ID: <12a40226-70ac-3a3b-3d3a-fdaf9e32d312@aklaver.com> Date: Thu, 13 Oct 2022 09:20:51 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.2 Content-Language: en-US To: pgsql-general From: Adrian Klaver Subject: Exponentiation confusion Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk In trying to answer an SO question I ran across this: Postgres version 14.5 select 10^(-1 * 18); ?column? ---------- 1e-18 select 10^(-1 * 18::numeric); ?column? -------------------- 0.0000000000000000 Same for power: select power(10, -18); power ------- 1e-18 (1 row) select power(10, -18::numeric); power -------------------- 0.0000000000000000 Why is the cast throwing off the result? -- Adrian Klaver adrian.klaver@aklaver.com