Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:121148 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 10528 invoked from network); 26 Sep 2023 18:41:32 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 26 Sep 2023 18:41:32 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 9191F180504 for ; Tue, 26 Sep 2023 11:41:31 -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.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS19151 66.111.4.0/24 X-Spam-Virus: No X-Envelope-From: Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) (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, 26 Sep 2023 11:41:31 -0700 (PDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 74C4E5C0112 for ; Tue, 26 Sep 2023 14:41:30 -0400 (EDT) Received: from imap50 ([10.202.2.100]) by compute4.internal (MEProxy); Tue, 26 Sep 2023 14:41:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= garfieldtech.com; h=cc:content-type:content-type:date:date:from :from:in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm2; t=1695753690; x= 1695840090; bh=g+wGOmac1yMUF0OA6xxFL+HMXNRwh/F/BusWTX7rmSc=; b=s +LK8/RCZ1+LQGWCwZJoVPLhq2gBn/OqmJjpXXKnMTGhPNm/OxJAnFehdKUWYT/jY SGP9S6DQG/I30tOPthfT6lrcSLR+qOOGdXrtzz9HmqugwitB/VvS91T7RYvjIvaH owoi5RcMCSfA1Lk7Vcn47qxbw3ZD8mq/XS3czr36TZ6u+F/eZ+3iDImMmeheBXpQ boyv/+CZp1fJTFoUQ4Wu3EOqLQ35S9g+ag5siqu6OtUcNOMB5alnp/nUw8UMz3/w AymuQ7H/nnM3uDmOOVJ9eYVhsaEcSnulzMInNme4Q16qp62RgaOnJf87SJUj9enW uZO3kK3KjP9y5cz6/e97A== 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:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; t=1695753690; x=1695840090; bh=g+wGOmac1yMUF 0OA6xxFL+HMXNRwh/F/BusWTX7rmSc=; b=WlEpKBC3CUf05P6UeSN7vkpXs9Bwu WuFou+0NZjIAKFi0z78nMXvTIUva7wq+BXmO0HTEQnLJRAu5ujokYAM9WEkrQaya jsCJFe5RsXn/PX57E/+qamgijVxoalDiUV9u9s5Nhr3KCeKF2SHKjVEAGX4WClwL 3GktxHrv7c0nQ6cyNd5iNEqyXL31YvdLcgfFxpZjhDN0GEhc7aRdmaDvLSKjKhKT OH4fCpTj9gXbeIvbeKFczf3QcsjBZqDVj0Qvpb/gmGC5y2V9Rjqab8sfk4tc3Vvz 3sUKlfxVre9OYA84yTLnyalFMbSV6A7nogkMEzuyTgTYnIJzjKZoOmygA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvjedrtddtgdelkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefofgggkfgjfhffhffvufgtsehttdertderredtnecuhfhrohhmpedfnfgrrhhr hicuifgrrhhfihgvlhgufdcuoehlrghrrhihsehgrghrfhhivghlughtvggthhdrtghomh eqnecuggftrfgrthhtvghrnhepveehhedvveejledvvefgleevffdtjeekledvkeegheff gfeivdejhffhledtudetnecuffhomhgrihhnpehphhhprdhnvghtnecuvehluhhsthgvrh fuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheplhgrrhhrhiesghgrrhhfihgv lhguthgvtghhrdgtohhm X-ME-Proxy: Feedback-ID: i8414410d:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 155221700089; Tue, 26 Sep 2023 14:41:29 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-957-ga1ccdb4cff-fm-20230919.001-ga1ccdb4c MIME-Version: 1.0 Message-ID: In-Reply-To: References: Date: Tue, 26 Sep 2023 18:41:08 +0000 To: "php internals" Content-Type: text/plain Subject: Re: [PHP-DEV] [RFC] [Discussion] Rounding Integers as int From: larry@garfieldtech.com ("Larry Garfield") On Tue, Sep 26, 2023, at 10:39 AM, Marc Bennewitz wrote: > Hi internals > > I'd like to put a new RFC under discussion: > https://wiki.php.net/rfc/integer-rounding > > Best, > Marc I'm honestly kind of confused by this. The basic concept, as I understand it, is sound. But the rest of the description seems to suggest that the returned type will depend on the passed-in type? That makes little sense to me. Since we already know that int is contravariant to float, I would expect round to return int if it can, float if there is a decimal precision set. ceil and floor should always return ints, unconditionally, because that's literally what their purpose is. But that RFC doesn't say that, which makes me quite confused. Similarly, the BC shim would therefore be (float)ceil($x), not ceil((float)$x), which... I don't think that would even do anything, would it? --Larry Garfield