Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:121244 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 16290 invoked from network); 6 Oct 2023 08:35:57 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 6 Oct 2023 08:35:57 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 3DBE41804B0 for ; Fri, 6 Oct 2023 01:35:57 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-ej1-f46.google.com (mail-ej1-f46.google.com [209.85.218.46]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Fri, 6 Oct 2023 01:35:56 -0700 (PDT) Received: by mail-ej1-f46.google.com with SMTP id a640c23a62f3a-9936b3d0286so340801766b.0 for ; Fri, 06 Oct 2023 01:35:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696581355; x=1697186155; darn=lists.php.net; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=wSfIiUYh7oFjLa6VjBvdOI1IQ+4yLhJvJ4CkFjYrgHk=; b=IFSFCn6eQAR+w5VvsgLkhoTWkBGkQN90cDiFEibft+ZSauAqKSoYBHIAQXcle6Y5QV TrtoPya3EJUz4CqIgLOTILgC91D05rdL5DQNYEPocvKrPlqXwGGJNrN8NHlnTXacUmEs fNOX3WpSm6dq3IYjH5GrPkX0g8wd/mJoQDLqw/lE9wp15aWsOBuQuo/02qzrjpv4c/zs IhjIYKqI8pZo2YV0i+WNzQ0dhSRDZum9kICcg13e/UrnDYiEaHvcxGCXNJdGkT6FWpXG mCNPFaO3TYZqm1gsrEAHrdJvKaPlQtoLhPVCyH+vK9A+IHz1xPuq2Jsn1HseotIN9xF2 5TNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696581355; x=1697186155; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wSfIiUYh7oFjLa6VjBvdOI1IQ+4yLhJvJ4CkFjYrgHk=; b=OEcGLL003nK5IVd9L3p980e9KJo8tD3SIJOs8G0KdYYwnuBr90yGzlnzulWPVCM8+f yeBEaFC9CW3U0w6Ni+hWEoR/uH5VvHKJFGDOxI4KfuvJRGMQyFlhdiXTlM/CM6QjbThM s3LcK5p70y60o5DWUNye55SzYA/XOUesIelNocDo+C80rxer2VNxj2q75Qv4iyNAOuIO lOmCpiwkmvXyQqeO9ljx79RrKBF0P68D4ODlGJghFQs6+srpcsJQR3vhdfajs9QYdbSj CQlFabKUjFCVrR3dx89op0rDKp3/pZDknTJIcUMBgiqOQbOF/ZZdB8NljDXJ7C4B9DIS TcMg== X-Gm-Message-State: AOJu0YxmJtXtp8g8PXUeD//0lFMe5NjGuPhqCBejvOnW+fkhHz1Au5Du b+H1HgFpTiRpBcMGTVEQkS0= X-Google-Smtp-Source: AGHT+IGVTdhmFAiI2MCdm502mXUfZB/+55e8pPuZo4/CUuGWnDe/J/rUyCXG1YFWg1UOkIwrqKxofQ== X-Received: by 2002:a17:907:784f:b0:9a1:fab3:ee3f with SMTP id lb15-20020a170907784f00b009a1fab3ee3fmr7148242ejc.40.1696581355321; Fri, 06 Oct 2023 01:35:55 -0700 (PDT) Received: from smtpclient.apple ([89.249.45.14]) by smtp.gmail.com with ESMTPSA id l12-20020a170906230c00b009920e9a3a73sm2500639eja.115.2023.10.06.01.35.54 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2023 01:35:54 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.700.6\)) In-Reply-To: <9812BAD1-5003-4E91-BB3B-00637B9687AC@sakiot.com> Date: Fri, 6 Oct 2023 10:35:42 +0200 Cc: Pierre Joye , PHP internals Content-Transfer-Encoding: quoted-printable Message-ID: <879AFA70-CD32-4170-8F98-F30EEBA7037F@gmail.com> References: <9812BAD1-5003-4E91-BB3B-00637B9687AC@sakiot.com> To: Saki Takamachi X-Mailer: Apple Mail (2.3731.700.6) Subject: Re: [PHP-DEV] [RFC] [Discussion] Adding bcround, bcfloor and bcceil to BCMath From: claude.pache@gmail.com (Claude Pache) Hi, > Le 5 oct. 2023 =C3=A0 14:26, Saki Takamachi a =C3=A9cr= it : >=20 > In fact, I predict that many use cases will be covered by GMP. >=20 > Still, I think that there may be cases where calculation functions = like mainframe BCD are required, such as when calculating money. >=20 > I am unable to decide whether it is correct to deprecate BCMath and = only use GMP. >=20 > I'd like to hear other people's opinions as well. >=20 We use bcmath in particular for money calculation indeed, and some other = things, most of them have in common to work with decimal numbers. For those purposes, gmp (in its current state) is pointless, because it = supports only integers. I could multiply my numbers with an appropriate = power of ten and work with integers; but in that case I could just use = native 64-bits integers: even if you work on Apple=E2=80=99s accounting, = they won=E2=80=99t overflow. > Le 4 oct. 2023 =C3=A0 13:39, Saki Takamachi a =C3=A9cr= it : >=20 >=20 > After all, I feel that BCMath and GMP have different roles. >=20 > Arbitrary precision mathematics and very high precision mathematics = are similar but distinctly different. >=20 > If PHP has already started integrating these things, then of course = I'll follow suit, but if not, I'm against these integrations. >=20 > If I missed something important, could you please let me know? >=20 None of the above. As noted, my main use of bcmath is neither arbitrary = precision, nor very high precision, it is decimal numbers. Of course, bcmath works equally well for manipulation of big integers, = which is my second use case of the library. Because I already use bcmath = for other things and I don=E2=80=99t need Legendre symbols, I have not = much incentive to switch to gmp for big integers. =E2=80=94Claude=