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 1nL2NV-00042c-2J for pgsql-general@arkaria.postgresql.org; Fri, 18 Feb 2022 12:28:49 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nL2NR-0002fm-Un for pgsql-general@arkaria.postgresql.org; Fri, 18 Feb 2022 12:28:45 +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 1nL2NQ-0002fd-NR for pgsql-general@lists.postgresql.org; Fri, 18 Feb 2022 12:28:45 +0000 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nL2NI-00046W-JR for pgsql-general@lists.postgresql.org; Fri, 18 Feb 2022 12:28:43 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id CDBBC3200E83; Fri, 18 Feb 2022 07:28:33 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Fri, 18 Feb 2022 07:28:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:date:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=pd/EjqBL2OVv6+icE09+/MRlBgiZDvdgPyMyGZXZAW0=; b=Def+UKEC NcoJZuaBAjXjHNuzQy+8DRpsDIY6E9d2jEQgw8/4zjltMzrO5oPIeN0ASazM7QFv vkBi5o/Re+sgsz8+IaTgElTyDvi10+e4XQfwN5vhAc8vGkspAVHRjnbXOdjGBI7+ KSZ+n9i8zqqv2qXEATi3Omscp3z90rhLvGdVfOdWJauPB5o8TDf86HWZAFmHbOfW HejRmM09lPp0Nj/RpL61WoKe59brmRHk7/ezv0tmBRRa22RN1/QHLS/pS5CIx+K2 k9mPavgxfNZa8jWv82fvIyPcUG5ZqQARaLYw3+SwnPsU1iWpWrJE5QHQAhcYa5EQ J0usFcOF79E8xw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrkedtgdefkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefkffggfgfuvfhfhfgjtgfgsehtkeertddtfeejnecuhfhrohhmpefrvghtvghr ucfgihhsvghnthhrrghuthcuoehpvghtvghrrdgvihhsvghnthhrrghuthesvghnthgvrh hprhhishgvuggsrdgtohhmqeenucggtffrrghtthgvrhhnpeelgfetfeeitdelleeggeej vefhueetfedvtdejheevueeifeegvdfhueeludetueenucevlhhushhtvghrufhiiigvpe dtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehpvghtvghrrdgvihhsvghnthhrrghuthes vghnthgvrhhprhhishgvuggsrdgtohhm X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 18 Feb 2022 07:28:30 -0500 (EST) Message-ID: Date: Fri, 18 Feb 2022 13:28:29 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.6.0 Subject: Re: Strange results when casting string to double Content-Language: de-DE To: Carsten Klein , pgsql-general@lists.postgresql.org References: <0d711ac6-6975-ae07-8963-aa91c6500776@datagis.com> From: Peter Eisentraut In-Reply-To: <0d711ac6-6975-ae07-8963-aa91c6500776@datagis.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 16.02.22 14:27, Carsten Klein wrote: > AFAIK, this conversion is done by internal function float8in, which, > when called directly, yields the same results: > > SELECT float8in('1.56'); > > --> 1.55999999999999   (wrong!)   on one server, and > --> 1.56               (correct!) on all other servers. float8in() really just calls the operating system's strtod() function. I would test that one directly with a small C program. It's also possible that different compiler options lead to different optimizations.