Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:115283 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 895 invoked from network); 3 Jul 2021 13:43:29 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 3 Jul 2021 13:43:29 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 5613918055F for ; Sat, 3 Jul 2021 07:04:30 -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=-0.2 required=5.0 tests=BAYES_40,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, 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-f51.google.com (mail-lf1-f51.google.com [209.85.167.51]) (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 ; Sat, 3 Jul 2021 07:04:30 -0700 (PDT) Received: by mail-lf1-f51.google.com with SMTP id q18so23629700lfc.7 for ; Sat, 03 Jul 2021 07:04:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:content-transfer-encoding:mime-version:subject:date:references :to:in-reply-to:message-id; bh=la4VhgWwNowzObDS5d+DFpVvAPOTTJzltHDXfl0L0Ik=; b=OTX7SkhAf/LgJKJlCIfgwi6Zoc0r8XylZu7c6jId94FUCXAkWr86DBB/f6wRr03AgO kBuu1rkPz4SlVfmqosVV2t0ZJ+M56jIBErQtL8TbQuXwxVXEF5zLxv2/YBBG53Ueiswk zM4GurhHSwLQCdDv6DFXUlqS/X11L/O16XrGLw9cJLldZomnPj9+MUzi9jCu5PsR9IS+ aiQ3bV+SBJbclTV6CE7khCAhgNZo656B1vl/qVgkmiGT046XqPNDtp/q5J35vaFcLd7u UDq6ntMRpDQ8AeX1ZPhgJ+MDlQwXQzzTkBkJQ2eSTGA+Mla4WdKEMzSBpzt2ZSfHpRao fLLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:content-transfer-encoding:mime-version :subject:date:references:to:in-reply-to:message-id; bh=la4VhgWwNowzObDS5d+DFpVvAPOTTJzltHDXfl0L0Ik=; b=mRdR/MVtONLHno1G56d5eyepVHkz5AD8a4vYlJT6hl9BSlHKzGIGePTJBR2ENlS9XP p1PiHWiCmQh5oomjmI4kVFiIRjNRl2TdoepMNkl/5JYS9hIAcgSFynMeiNE4Zwf/g7qb h4iId6FyGHfuzMpdFemAbbLKRd7HuVG+X1Ad06tMAZi+ZAkwDgj2kVdRj58DUjz4HwRe fqkaMuxzbwPweJSsCZyvkJEzZv4vPmaKE5t6UNwyK0hdFTeiXRy5aMU0oLNkGjxtk7PQ FbiSNJVhEyCCA2c/BlOYMjmvduToJgX74Uxo8uNLxhgEj6WZlRMKLylXEXT0a53yByGx OFNw== X-Gm-Message-State: AOAM533jRpBRuMfRoLjkKfPQtjnPruRu/re+DM6MkrNnfhfzfgyxgUMK sDTXqjtLq8YrJYgFs3wWvzFg0p0nEPtFiw== X-Google-Smtp-Source: ABdhPJwipIgEZjVaYc8OVBBXKib5RKvdC4BDoItQRDU05UZkGSbLWCO5irYxkGICYaTGhsdrFA9TRw== X-Received: by 2002:a19:dc02:: with SMTP id t2mr3623520lfg.563.1625321068141; Sat, 03 Jul 2021 07:04:28 -0700 (PDT) Received: from [192.168.2.137] (81-233-163-178-no84.tbcn.telia.com. [81.233.163.178]) by smtp.gmail.com with ESMTPSA id z8sm553273lfh.119.2021.07.03.07.04.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 03 Jul 2021 07:04:27 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.7\)) Date: Sat, 3 Jul 2021 16:04:27 +0200 References: <0BBAA2F7-02D7-4AEE-B48A-97436A0D8E5D@gmail.com> To: PHP internals In-Reply-To: Message-ID: <19102874-12E9-448F-AC69-C71BEAFCDAF8@gmail.com> X-Mailer: Apple Mail (2.3445.9.7) Subject: Re: [PHP-DEV] [RFC] clamp From: hallbergkim@gmail.com (Kim Hallberg) > On 28 Jun 2021, at 11:16 AM, Nikita Popov = wrote: >=20 > 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. >=20 > I'm not really convinced that this is a worthwhile addition, but also = not particularly opposed to it. >=20 > Regards, > Nikita Will update the RFC with a more precise description. Didn=E2=80=99t know = there existed IEEE standards for clamping operations. Adding exceptions = for NaN values into min/max is something I agree would be expected = behaviour since a non number in the range don=E2=80=99t really make = sense. As for the negative zero behaviour though, I=E2=80=99m not sure how to = address that since frankly it=E2=80=99s out of my league, and when would = a range of -0, 0 make sense to have? Cannot see a value being placed = between that expect for 0, so a `clamp(0, -0, 0)` would return 0 then? Thanks, Kim.