Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:122595 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 0007E1AD8F6 for ; Sat, 9 Mar 2024 19:29:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1710012592; bh=hgNxdwnnABGubY0BBOY6l2dvjUHxJth2z9imozastLw=; h=In-Reply-To:References:Date:From:To:Subject:From; b=CLMAMHksPb+pqVGTgNDHSKuuffrtl6mRePc0XwszJh8HvhJ9d+m3ceB2yDxyCM6GW KRCaZQkS4m8h52XIMousrcgtJBcx/4l1A7CYEVMipDL+lUVi9e/qEGlrT6qWC3g4gG n0ZIegKs6wNum39r0VuLjCyufMYCsEtY3W+v12FFoup0cK+2SXKc8qaA/wo+7bhr0P WAOiZgN1mBM/764iWpkpcyKi2+tCh/VAPiiCZGNcd+yqSrFTOXczfSC5IFG8IIDeV8 41dmiqWZy8LBRoYXh9hrbhy7R6Mrl/Q/VgI4K+A8RDXXvDdAHF141Yhd9109R7LvFW 1YAOf0AQA/Bqw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 6CFA2180078 for ; Sat, 9 Mar 2024 19:29:50 +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_PASS,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from wfout8-smtp.messagingengine.com (wfout8-smtp.messagingengine.com [64.147.123.151]) (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 ; Sat, 9 Mar 2024 19:29:48 +0000 (UTC) Received: from compute7.internal (compute7.nyi.internal [10.202.2.48]) by mailfout.west.internal (Postfix) with ESMTP id 0D3BA1C0009D; Sat, 9 Mar 2024 14:29:31 -0500 (EST) Received: from imap47 ([10.202.2.97]) by compute7.internal (MEProxy); Sat, 09 Mar 2024 14:29:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= trainedmonkey.com; h=cc: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=fm1; t=1710012571; x= 1710098971; bh=0mCTmTL0TiRRcYL1aF9vZUbIdT3fVprenVmARwO4afU=; b=n R8rOZuFEfkkfQzjzMLS4Wy41R/QDUF4bIWisKpDUF3BsjLxz5HUlWB56aPYhhgEY fYy5G3PjSeMUAGd28rALqdRWZNQfbvrLi7h/DVoqX1UigYAMT16vES7iRIGv27P2 pU5Jec69aHj7JIWr7mZJ20y3uaYHYUyvmXTKTt7hQazDiTwClnPEvCNIeLQ21sRd vin1z5Ef4ynAJG3Rarjgp+8kJbd7tXvctm4Mp77uvTDTVfsLvbpTFdLpgjAHQvti Q1S/4ZgkPtQfI/CBF3n19LUE84jPZw4rWH3vjlwa1Tt4L86QgPxhQcxKA68rqi7q U6ME5/Y3ggEovS5roXzlQ== 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:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1710012571; x=1710098971; bh=0mCTmTL0TiRRcYL1aF9vZUbIdT3f VprenVmARwO4afU=; b=H7ZnMgavzLIIKwOtj3zntDZkQ3UuG2igLIipZrPeVfAp ESo/fQIVpls3qR0yvaDu6tB3pG2KTeaOODbgIQwMeq4FD3DkuwgWAKQ34QHRC2FV tlXkXGNUMmzmqubYVBWX8xjVfWp3tF+CpnE6hJDykOYCzumyVGdR5HWNaogR1/ZY awQcZbD/sRFoLGYdmw0khrFZyQCad6Fs/yX5P1XCQFD7LJgvrSPQVzuAHLyoVrG7 wCmffLo5BNYYzZwOn7vpY52sz0sKGTv/jr/T7eG2QihatxCWIBhGCJLj8VR/sPdA pdpFB58zCLV3mRFhuahNv6CqKfD3u5UVF8KYf5G8RA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrieejgdduvdduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvffutgesthdtredtreertdenucfhrhhomhepfdflihhm ucghihhnshhtvggrugdfuceojhhimhifsehtrhgrihhnvggumhhonhhkvgihrdgtohhmqe enucggtffrrghtthgvrhhnpefhieelkeelgfffheegtedvleduvdeuvddthfefheejkeel keefjedttdetieelkeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrih hlfhhrohhmpehjihhmfiesthhrrghinhgvughmohhnkhgvhidrtghomh X-ME-Proxy: Feedback-ID: ia2404087:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 13E71A60079; Sat, 9 Mar 2024 14:29:30 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.11.0-alpha0-251-g8332da0bf6-fm-20240305.001-g8332da0b Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 Message-ID: In-Reply-To: <73b032ec-b41a-4b96-8254-f0b68abf87f2@app.fastmail.com> References: <07407c20-09ea-4bb9-a5cf-3af41b9234ee@mabe.berlin> <8a96a374-eaf8-4ac6-b45c-61d2a0c9652f@mabe.berlin> <73b032ec-b41a-4b96-8254-f0b68abf87f2@app.fastmail.com> Date: Sat, 09 Mar 2024 11:29:10 -0800 To: "Larry Garfield" , "php internals" Subject: Re: [PHP-DEV] [RFC] [Discussion] Rounding Integers as int Content-Type: text/plain From: jimw@trainedmonkey.com ("Jim Winstead") On Sat, Mar 9, 2024, at 8:00 AM, Larry Garfield wrote: ]> If there's some math reason that we cannot have those functions return > int (someone mentioned there was, but I don't really understand it and > the RFC does not explain it at all), then we should at least keep > consistency in the return type. "Sometimes I have to cast the return > value before I can actually use it in the obvious way, sometimes I > don't" is not a good situation. The round() function has to be able to return float because has an optional precision parameter. So round(3.14, 1) returns 3.1. I agree that there doesn't appear to be much of a reason that ceil() and floor() should be returning float. The documentation for ceil() says: The return value of ceil() is still of type float as the value range of float is usually bigger than that of int. Jim