Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:122754 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 2A1541A009C for ; Tue, 26 Mar 2024 14:40:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1711464052; bh=SqA8Huud2l1cTbs7evhiulau5REygBlNpaUHYNLh2aA=; h=In-Reply-To:References:Date:From:To:Subject:From; b=YmF2avGSoOneI47BwiR9HfJh9Aev+j/NWtraIHeuNAt433hCOJMYFvTU7hvIhLfD8 /zf7eagEkvntTeLWEl5pKv3hK3lC2SbNgtseTz8eaX+VeeDjGZ8ArODWkWJvIs4XVI ayTXZSr+byqlUHGyBvmQpa7Wq5tBzagg7Ogyf6hZZIzKtqGzEJJqmMuDZgdSa6psm8 doHWz7NhDD2Y02IlMyOXPIDNozBfGgfE3QoZubJCwtBIPxSFvFkrLEaARZNMh0zME/ RYp0qNokVJcwMNbLyC3jSdGr/t6Ab5VpfE9b4vOHqWFT9XyMSASya26vr6KQOSBsQl mQ37N3rgexgmw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 2652018055C for ; Tue, 26 Mar 2024 14:40:51 +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,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) (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 ; Tue, 26 Mar 2024 14:40:50 +0000 (UTC) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id D2E905C0066 for ; Tue, 26 Mar 2024 10:40:25 -0400 (EDT) Received: from imap50 ([10.202.2.100]) by compute1.internal (MEProxy); Tue, 26 Mar 2024 10:40:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= garfieldtech.com; h=cc:content-transfer-encoding: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=1711464025; x=1711550425; bh=yXZfNNUsOOJCGCDnTvwVg jSS+k6paABxoDdsLvc6va8=; b=Fgbq6VR9yySpK3n6IxCfQ5aDIPMqG1BgorERg 872IxBI1NhJUI3xAZ/Cnf2kIvBg77Qy+iKnYG4FFF3EI79KewHru9rZ/8gFB/wMX BnWSgRVZO00e2tvgMrYy7OcdkX/2JkRjlYMupVYunVGki1TlvCNcus3G/xVGCiQx VQs4bY9UgihQZWRuINybkHVs5hjzlaJdwmhF4IHkeVByEdPXp9Wrq4I1tAeCE4qz j9C2pr27aoEDUhUxgFL43o/80R2WkdF4L3FL23RpZ6DX05NOQKKBaAskFf0Lru5x QQ9oNG0lYWabiGB+0bf9rCvd4uv5OVFIGtLpo2a9If635v37g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding: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=1711464025; x= 1711550425; bh=yXZfNNUsOOJCGCDnTvwVgjSS+k6paABxoDdsLvc6va8=; b=B 5EiNdGdfkvTvj1UdDh7hqQX/UdoIdyoRJY0cOOcWtCo1v2Ke9AEwCPQHL0UMKB28 8GojxF9lvS1cKJSR0NFaxHPFYcPOqyLDqQdVgdkb1RFqtGr04rXxV0uxArA0IZ+w BMIgIubB7FdoABqu9EmFb+rQj922B/hicbNhiPFapYht6LdwASmgqic7KZPqNdEJ vHaPeum91RrEW44SrduR/v7IdJ22bqik+rNhs0UkEMdfKRxYih8uIfnMeP9yfceL uV/c7QBWpuGXnFQ8sWu2e6DLLhoFre2Wziw4+25+gvcTjvFRhmXmDrGW0W8F0YZM sclBA0yxlNcNlgK/Z5fBw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledruddufedgieeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvffutgfgsehtqhertderreejnecuhfhrohhmpedfnfgr rhhrhicuifgrrhhfihgvlhgufdcuoehlrghrrhihsehgrghrfhhivghlughtvggthhdrtg homheqnecuggftrfgrthhtvghrnhepffffffejffdugfegvedviedttedvgfejffefffej leefjeetveehgefhhfdvgfelnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpe hmrghilhhfrhhomheplhgrrhhrhiesghgrrhhfihgvlhguthgvtghhrdgtohhm X-ME-Proxy: Feedback-ID: i8414410d:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 8591A1700093; Tue, 26 Mar 2024 10:40:25 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.11.0-alpha0-328-gc998c829b7-fm-20240325.002-gc998c829 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 Message-ID: <0e9e98db-2ce2-4782-b1ba-e26ef509e76e@app.fastmail.com> In-Reply-To: References: <4F094EDA-5058-407D-AF39-06FD934FDE1F@sakiot.com> <38d69258-cdaf-45d3-ba52-dc1398301c8c@redmagic.org.uk> <5085240B-75B8-40B8-81B9-0E80B80B7C44@sakiot.com> <48be5c48dfa8ae2498d185322dd83aa3@gliadin.co.uk> Date: Tue, 26 Mar 2024 14:40:04 +0000 To: "php internals" Subject: Re: [PHP-DEV] [RFC] [Discussion] Support object type in BCMath Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable From: larry@garfieldtech.com ("Larry Garfield") On Tue, Mar 26, 2024, at 12:50 PM, Saki Takamachi wrote: > Hi Barney, > >> No, that's not quite what I meant - I meant more like the opposite: >>=20 >>=20 >> ``` >> $bcNum =3D new BcNum('1234567890123456789.23456789'); >> echo $bcNum->format(8, '.', ',') // 1,234,567,890,123,456,789.23456789 >> ``` >>=20 >>=20 >> Maybe also worth providing a way to specify that all decimals should = be printed, instead of just a fixed number of decimals. > > Ah I see! It sounds exactly like `number_format`. Sure, this might mak= e=20 > sense. To me, this seems worth supporting. > > > BTW, > ``` > $bcNum =3D new BcNum('1234567890123456789.23456789=E2=80=99); > ``` > > When I saw this, I thought that the behavior when $scale is omitted is=20 > that in addition to the option of "using the global setting value",=20 > there is also the option of "counting the length of `$num` and storing=20 > all `$num`=E2=80=9D. In other words, it does not use any global settin= gs. > > Which of these do you think is better? Global mode settings are an anti-pattern in most cases. Please avoid th= ose whenever possible, as they lead to unpredictable behavior. --Larry Garfield