Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:115167 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 57939 invoked from network); 28 Jun 2021 08:57:10 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 28 Jun 2021 08:57:10 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 855A11804CC for ; Mon, 28 Jun 2021 02:16:53 -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_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com [209.85.167.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 28 Jun 2021 02:16:52 -0700 (PDT) Received: by mail-lf1-f52.google.com with SMTP id k10so31306642lfv.13 for ; Mon, 28 Jun 2021 02:16:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=8agVRuFLcJsDY5uC2LkEE1efJokOyaWInXM6WZacGP0=; b=J2NmUqqdFtW36Wlgk+9XvXgTe07HmoAfdiyeBsgn/x6JAxix5swjzxKq76e1KS/AGu Hgv9TifrAlw0LAtijcvSUTjOf78xppdyp/6xj394NSXhhGqUA8ZFoKRWFQ2uG5i2xPP/ iwY6s0b+ptjWwDXMr1erwJO0O9JmQbscnX5BO4xiWN1ix5BrhEuzTMsMUqUIACQJKgoc aYk7b7upo6aOLepeybQzEYlDuIGs5oyOh/f8WcgjrQq7K2vWhgtSFqpQ/vR/GzlTWz7u kjWp6bUKCFLYh0E5gNi0ws4ir/xQmTzp+Tfrb/JKI3rWMMJIB7g/87HXJYDY/R/ARpVZ I91Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=8agVRuFLcJsDY5uC2LkEE1efJokOyaWInXM6WZacGP0=; b=KNbQ7LJmtfeySaBHd2hDL/nj9M2DOgwekGIzqXMvNRw2CQ3kgkDNoUnSSRPACVVlCW n0XlEk/akohe6DvB/x16Nktg9TPE3ZfcPpAHm9qvuOQHD8U6mYEH5m6lDZCEwQrh7yZ3 99gOS4lgWo4cZ3LZHxBvQtxyy1FyuHdiccism8zIhRer5Ol/xbvvPGEhH1v+jDwVCSN2 0HAgEd2WEKb25kiMfhf/PiSYEmX753xP4QyHOpePWjsP6SHtqTvDE4NKDM/m97HYIAYD QZFyzQdek7O8A81Xy01kYrimwilqz01sTDGWNRGrC3Dtk40e5Gj7mMpcLw8ZrbJAWyLs JpWA== X-Gm-Message-State: AOAM530KR6CeKVATVuqH7s6Zd7EyW05jB8iYQq9pB7CHGBz9fGTv/QQL gNVxHx+Ne7fYSgjOeAJJFTxVlry8O1pT0A7rhCo= X-Google-Smtp-Source: ABdhPJxin8PVQFGR/QDxtX5vGzM57o37RlAx01BaiJC1/diIMHrtbryiDjR/hPnmT6xvGxnCGLGgxrkaEeSh2+bYKJM= X-Received: by 2002:a19:7d05:: with SMTP id y5mr18233088lfc.159.1624871808796; Mon, 28 Jun 2021 02:16:48 -0700 (PDT) MIME-Version: 1.0 References: <0BBAA2F7-02D7-4AEE-B48A-97436A0D8E5D@gmail.com> In-Reply-To: <0BBAA2F7-02D7-4AEE-B48A-97436A0D8E5D@gmail.com> Date: Mon, 28 Jun 2021 11:16:32 +0200 Message-ID: To: Kim Hallberg Cc: PHP internals Content-Type: multipart/alternative; boundary="000000000000f80ac405c5cff23e" Subject: Re: [PHP-DEV] [RFC] clamp From: nikita.ppv@gmail.com (Nikita Popov) --000000000000f80ac405c5cff23e Content-Type: text/plain; charset="UTF-8" On Wed, Jun 23, 2021 at 8:43 PM Kim Hallberg wrote: > Hello internals, > > The RFC for the clamp function is now open and under discussion, you now > have 2 weeks > to discuss, suggest improvements and open issues before voting is > considered. > > Any and all feedback is welcomed. > > The RFC is available for viewing here: https://wiki.php.net/rfc/clamp < > https://wiki.php.net/rfc/clamp> > The implementation is available in a PR here: > https://github.com/php/php-src/pull/7191 < > https://github.com/php/php-src/pull/7191> > > Thank you, > Kim Hallberg > The RFC is missing a precise description of how this function works with NaN and negative zero. The expected behavior is that if min or max are NaN, an exception is thrown, if num if NaN then NaN is returned, and the behavior wrt negative zero is unspecified. This makes for an IEEE754-2008 style clamping operation. Making negative zero smaller than positive zero would be an IEEE754-2019 style clamp. I'm not really convinced that this is a worthwhile addition, but also not particularly opposed to it. Regards, Nikita --000000000000f80ac405c5cff23e--