Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:120390 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 33103 invoked from network); 22 May 2023 21:39:11 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 22 May 2023 21:39:11 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 814291804AA for ; Mon, 22 May 2023 14:39:08 -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,HTML_MESSAGE, 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-oo1-f53.google.com (mail-oo1-f53.google.com [209.85.161.53]) (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 ; Mon, 22 May 2023 14:39:08 -0700 (PDT) Received: by mail-oo1-f53.google.com with SMTP id 006d021491bc7-54f92ee633bso3187530eaf.0 for ; Mon, 22 May 2023 14:39:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684791547; x=1687383547; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=xKBR24kIFmspcBSzMSq+ZtosR2HwnVVcLb6fnfRhNbk=; b=KDlxLAQ21k9RLkyF4J5su4JeFYVRJkIR38bUZ+9GRLbLySNON408LlsS5m58v+/N4y tWmh9y8+wVIn87GyeC4iC50MHAHeKxTX+vEe0xC7wjAwq6pebrVXpmx4+56l8kH1/zLw ZCWxvnsRqzP+yzA7HMtzXt6MFt1zIF6e5OqZx177zG7NJlW9Vd99G1536LwMB+jbp4EU HzlbNRl/nP9DDOwEzT8HsekGDhTQMjJOTW84dZ4lEPMlL0GN96bwA3KKoRtoWO0GokqF Pxo9M03IHPTPvODRSU7lBhynJ7mtGShxxtWt8GM4LDyW3X/B45IbcpWwG1dRmqmk2ITg a4/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684791547; x=1687383547; h=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=xKBR24kIFmspcBSzMSq+ZtosR2HwnVVcLb6fnfRhNbk=; b=VRoLjF/j1XpMLWtg+0DC5QnBVfFmSWeY9B475Wd0t7K95BUW9IPLieBv8dWYatsRmT WmEidt1C0EvpB5vIAR+aZLj5S8CDndgZWteWzErjsY5GO1cZuSH6aELsKppAN0eUEJk2 niLvIL6U12pnPNdq5yIb4e5UAFHe6RsfS+py42/fd5FPe5lh6r5THHhaFHls/9dJixhy jV1c+vK2vSeg7fhRirKW2b8C+McSUzIv8XRLRxs4Q7cUNW0eVNndXtqgiOHvsOwColdR j4adSrn7FQULjlde7UzUdjWlcR1Dyuzu4D178IZJtqqVrmO4nOzpfZDglFJ87LQizoxn 6g8Q== X-Gm-Message-State: AC+VfDxRRZCA5cTeEg9PBPotoYO+YfAcDpMudUYnGCckWy8l/RHE1AuE NN9ewZirc6tiCAUrsOQRiuF6UMV4vOYAMs4SPXZLBCcc X-Google-Smtp-Source: ACHHUZ5Ew2viHENxLFjGeP3lS3q6yXQ+Aa5pH+LOI4oVX9yEMH6mx5D5iyhv5wgZZb2Y3I6LGqCpq1I9xXhwW7dQNGo= X-Received: by 2002:a4a:9c50:0:b0:54f:b59c:256a with SMTP id c16-20020a4a9c50000000b0054fb59c256amr5861770ook.4.1684791547046; Mon, 22 May 2023 14:39:07 -0700 (PDT) MIME-Version: 1.0 References: <05b7e019-27d4-e6a9-2088-f712c22317a9@mabe.berlin> <4D8DE606-5E99-4D6F-962E-CBE1392C4B94@gmail.com> <8b23cbe6-1c4d-40b6-a68b-780d5e8f9dbf@app.fastmail.com> In-Reply-To: <8b23cbe6-1c4d-40b6-a68b-780d5e8f9dbf@app.fastmail.com> Date: Mon, 22 May 2023 22:38:56 +0100 Message-ID: To: php internals Content-Type: multipart/alternative; boundary="000000000000aeb61f05fc4f197a" Subject: Re: [PHP-DEV] rounding integers From: davidgebler@gmail.com (David Gebler) --000000000000aeb61f05fc4f197a Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sun, May 21, 2023 at 4:21=E2=80=AFPM Larry Garfield wrote: > > Having recently been bitten by floor() returning a float even though the > value that comes back is logically an int, I would be fully in support of > "and returns an int" versions of these functions in core. > What about adding a third, optional parameter to round() which is a flag (or bitmask) to specify preferred behaviour and return type? Kind of ugly, but maybe less ugly than another new function and no BC-break, as the default can be the existing behaviour. -Dave --000000000000aeb61f05fc4f197a--