Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:123043 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by qa.php.net (Postfix) with ESMTPS id 91B3D1A009C for ; Mon, 8 Apr 2024 13:39:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1712583592; bh=Ugc2qRpsfOJYBzPhLpRZ4onCekJ9cU+iCLkGfGgOImo=; h=In-Reply-To:References:Date:From:To:Subject:From; b=cA1A8lnjRJtoeBQoKyMOPYPkfBf/j18wmjBmFFtlmYOBV8c7k/JSfbFP9sccqf/TH PHERMJlitxOmsXKymCJ99WBrPZqF+ZfMpiX0T9aL2Nbwsvil6pXUCxBQ0U8ttlNJo3 NZersguummTbHf4ZnJ/8tvNiCs/hD+q6HNqoHIKwggW2fuzch5djntETsYiTq0SDuu ZDWhdlXWy4I40FazP5Qe/+tlK3WhfCj9omdRbN1drX3+8WEKecKjVSREZ8IO2D3aWq YkMOBhqqwrhFX92F438rG6cE9IWnWSIZzHZFL3JdasLleBXFjKOe4NiiL4RjX4MVtu pzAlxEDLieUJQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id A6F0218055E for ; Mon, 8 Apr 2024 13:39:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,HTML_MESSAGE, RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from wfhigh4-smtp.messagingengine.com (wfhigh4-smtp.messagingengine.com [64.147.123.155]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 8 Apr 2024 13:39:50 +0000 (UTC) Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailfhigh.west.internal (Postfix) with ESMTP id 73A1B18000E5 for ; Mon, 8 Apr 2024 09:39:17 -0400 (EDT) Received: from imap50 ([10.202.2.100]) by compute6.internal (MEProxy); Mon, 08 Apr 2024 09:39:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rwec.co.uk; h=cc :content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm2; t=1712583556; x=1712669956; bh=W3Ylvm6cGP 9XHEOwYso7Yt6I4sorSErBlJ4rkVxfCJk=; b=jXA1bv5CSMY8kPn6EfKgKup4kJ EoCk/GpSfhSkcH6XKXx9nDrfFqSjiiYvVJQxP9JvECiWrcUaz0ggCP3ZZ8+QBV+y x4gf1nQxToAeGM3mlvJoKjKruE5CceUq1mSXuEnyjdGJ6Wzh5oCKSmFyvjrT+KeY xitIUwe6aDqzN2gLtxAPE3dxoeerY9MEzt0a9B/TOOVzzJ/crsPtmKZfSd9ozkAw TEnBHKnSs1kxq6LdONMJewYjga1p21tssbxvW4kQ8Tm2yKVFni5ew7afZGA9myfm ys2WnatESiEgPaaxjbeDhvMzS9vf1mdeSFHWnixYkR1Yv6UjRfulb/+UliVw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; t=1712583556; x=1712669956; bh=W3Ylvm6cGP9XHEOwYso7Yt6I4sor SErBlJ4rkVxfCJk=; b=CDq+f0tUAQtmP4/w2NdLy2TcfXViCZcG1M6vwA9mDyKo 2PcoRWD86PiRVuiLmnt+yvLbzrcGmsFN6xIrvc+aUINfp7EtbXJ45oYrTOtiTlEY rHTnA8HRQ+vNNpK7Pn94bpGK3oTtO1Jz7OUaWNuSev8fM0Q2Twx9SF4l56rHzHbo 1yUhIzPHoCxAi0cQ10grbd1/gqObnk33iOv+Z3HCr7vjV9S0F/qdlSTxx2/Sk8vp F3MNEKEDXKLSEb/RhIcCuAlSQIUtfPPBT2Xmv6hyE16bfC1YsCgS36FW3rRdguOH iwJtpVFSgUvFdnlnqPqGw/KmVPBF9w3dLKSIByDzyw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudegiedgieeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefofgggkfgjfhffhffvufgtsegrtd erreerredtnecuhfhrohhmpedftfhofigrnhcuvfhomhhmihhnshculgfkoffuohfrngdf uceoihhmshhophdrphhhphesrhifvggtrdgtohdruhhkqeenucggtffrrghtthgvrhhnpe efveeuieduffegleejjeetffejhedthfegueeuffegueffvdeludeuleefudffffenucff ohhmrghinhepphhhphdrnhgvthdpghhithhhuhgsrdgtohhmnecuvehluhhsthgvrhfuih iivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepihhmshhophdrphhhphesrhifvggt rdgtohdruhhk X-ME-Proxy: Feedback-ID: id5114917:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 8C0591700093; Mon, 8 Apr 2024 09:39:16 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.11.0-alpha0-368-gc733b1d8df-fm-20240402.001-gc733b1d8 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 Message-ID: In-Reply-To: References: <40553F28-2EC2-475A-BD8E-1D6517AA2A51@rwec.co.uk> <2B518F62-B774-45C9-82A2-EF6653AAE34E@sakiot.com> <57c268e9be57edad86155c461b0fd181@gliadin.co.uk> Date: Mon, 08 Apr 2024 14:38:55 +0100 To: internals@lists.php.net Subject: Re: [PHP-DEV] Native decimal scalar support and object types in BcMath - do we want both? Content-Type: multipart/alternative; boundary=a9238298cfc54d15a24a2441758ea4a5 From: imsop.php@rwec.co.uk ("Rowan Tommins [IMSoP]") --a9238298cfc54d15a24a2441758ea4a5 Content-Type: text/plain On Mon, 8 Apr 2024, at 13:42, Arvids Godjuks wrote: > The ini setting I was considering would function similarly to what it does for floats right now - I assume it changes the exponent, thereby increasing their precision but reducing the integer range they can cover. If you're thinking of the "precision" setting, it doesn't do anything nearly that clever; it's purely about how many decimal digits should be *displayed* when converting a binary float value to a decimal string. In recent versions og PHP, it has a "-1" setting that automatically does the right thing in most cases. https://www.php.net/manual/en/ini.core.php#ini.precision The other way around - parsing a string to a float, including when compiling source code - has a lot of different compile-time options, presumably to optimise on different platforms; but no user options at all: https://github.com/php/php-src/blob/master/Zend/zend_strtod.c Regards, -- Rowan Tommins [IMSoP] --a9238298cfc54d15a24a2441758ea4a5 Content-Type: text/html Content-Transfer-Encoding: quoted-printable
On Mon, 8 Apr 2= 024, at 13:42, Arvids Godjuks wrote:
The ini setting I= was considering would function similarly to what it does for floats rig= ht now - I assume it changes the exponent, thereby increasing their prec= ision but reducing the integer range they can cover.

If you're thinking of the "precision" setti= ng, it doesn't do anything nearly that clever; it's purely about how man= y decimal digits should be *displayed* when converting a binary float va= lue to a decimal string. In recent versions og PHP, it has a "-1" settin= g that automatically does the right thing in most cases. https://www.php.ne= t/manual/en/ini.core.php#ini.precision

= The other way around - parsing a string to a float, including when compi= ling source code - has a lot of different compile-time options, presumab= ly to optimise on different platforms; but no user options at all: htt= ps://github.com/php/php-src/blob/master/Zend/zend_strtod.c
=

Regards,
--
Rowan Tommins
[IMSoP]
--a9238298cfc54d15a24a2441758ea4a5--