Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:121612 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 44129 invoked from network); 7 Nov 2023 20:42:31 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 7 Nov 2023 20:42:31 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 6BBCE180503 for ; Tue, 7 Nov 2023 12:42:30 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,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-lj1-f170.google.com (mail-lj1-f170.google.com [209.85.208.170]) (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 ; Tue, 7 Nov 2023 12:42:29 -0800 (PST) Received: by mail-lj1-f170.google.com with SMTP id 38308e7fff4ca-2c7369df9d6so5004791fa.1 for ; Tue, 07 Nov 2023 12:42:29 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699389748; x=1699994548; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Vu4USzFKMnMkGueRWBbekXMgMz3zkAs5vPHnECdvL68=; b=ZO3Val0SocVUMSKEqhO4fpB+qse20SF3f3nWAJuo0NGLLQNaTi1ium1qpEooWt4y87 h8HgNNkr5A/P9egfSan1QKKziYAUSUlHzw+45cPd50p41F6S7KMaCltEeu4Ob0tF5Ytj jOEMwY7Ei8a542HeiJYQbAXyGf6RO8e35GN3t4kc/jLF1xqf5J+d+JojjGgPmJWeG+hV vxie0dTmK1v388/uwlDFhrOOveFBaAzf8BXLi/W62y4+vZZZAmWpsA2Ggk2ME1qB2dvK THNjGm0iwQCDQcTKcB36x0oVoOgOrQAidVUYfaJZjNQZbH5JOK6wVC6SNSLWjAI8SEBw FLUg== X-Gm-Message-State: AOJu0YySkkJR4LYkYQu8JGuOISMoToPePbWk3BXLNU0gGieIyxmEdh33 UPlJMQb2yf3Rhq6iZZc+tV46J4kU1kLt1z01RjO+wB6TxZw= X-Google-Smtp-Source: AGHT+IGJxom1bky7UqqX4tDU/l4cZSrUGK63LOnovizIWnJqfmiGunVXgVc0zlediV6KgkQPGDwBNL0R4PWSJBa2KDY= X-Received: by 2002:a05:651c:200a:b0:2c5:1f5f:ed96 with SMTP id s10-20020a05651c200a00b002c51f5fed96mr91155ljo.3.1699389747885; Tue, 07 Nov 2023 12:42:27 -0800 (PST) MIME-Version: 1.0 References: <095E59EE-173A-4114-AD3F-4B830CD2E295@sakiot.com> <2BD1AE90-F082-41AB-8F5E-7F5257142874@sakiot.com> In-Reply-To: <2BD1AE90-F082-41AB-8F5E-7F5257142874@sakiot.com> Date: Tue, 7 Nov 2023 20:42:16 +0000 Message-ID: To: Saki Takamachi Cc: Michael Wallner , internals@lists.php.net Content-Type: multipart/alternative; boundary="00000000000041f9ef06099602df" Subject: Re: [PHP-DEV] [RFC] [Discussion] Change the edge case of round() From: bukka@php.net (Jakub Zelenka) --00000000000041f9ef06099602df Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, please do not top post - you might want to check these rules for PHP mailing lists: https://github.com/php/php-src/blob/master/docs/mailinglist-rules.md if you haven't seen them already ;) On Tue, Nov 7, 2023 at 4:07=E2=80=AFPM Saki Takamachi wro= te: > I have added as much of the rationale for the changes as I can think of t= o > the RFC. I would be happy if you could see it again. > > It would be good to also mention original reasoning for preferring the decimal edge cases. It says: > Of course, one may argue that pre-rounding is not necessary and that this is simply the problem with FP arithmetics. This is true on the one hand, but the introduction of the places parameter made it clear that round() is to operate as if the numbers were stored as decimals. We can't revert that and this seems to me to be the best solutions for FP numbers one can get I think it's got a good point with the second parameter and it's something that voters should consider. You should not probably say that's current implementation is wrong. It just chose to prefer decimal format and address the edge cases explicitly in a way that it makes more sense to users. Obviously it didn't fix all issues but we can potentially continue in that approach which is what you did in one of your PR's - it would be good to probably also note that such implementation is more complex. Regards Jakub --00000000000041f9ef06099602df--