From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by sourceware.org (Postfix) with ESMTPS id 6C7913858C5E for ; Fri, 10 Mar 2023 00:51:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6C7913858C5E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wr1-x430.google.com with SMTP id h14so3616003wru.4 for ; Thu, 09 Mar 2023 16:51:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678409503; h=in-reply-to:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=DCQ96yW0VTujvanxGU+ddpqpfeR+kUlad/xiO2WbD1s=; b=dXa+ZUm6HRUYosSgzm7zGvn5ppZXd9zGYf6JXoQHIxpM47z5BTq9HxhTkkMdXBM7gw n9ky7463pK/FDRuELQ41raQjy6KkqRWX14RHghNGRQ9hyxEymyAStML7EGwmosNEF0Zo 0L0FH/Ne93kX4ojSJOG93n+vmocP1d7ZONJ4PV/1e8UQHvDqejcp6mIxVmL2BSkGUZJD fhH95JiscdajFgW4sLoheLy+VkDJAoxDThlTgvYU96yX9vxkPmDztHpV8xaoCawuxhuA NqSDdlEHXZFsaJ9WGkyt5rzYF/8Yld1cqZIGF2541jfyopThNV3E6FRqx1CekkiwL0FW wZSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678409503; h=in-reply-to:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=DCQ96yW0VTujvanxGU+ddpqpfeR+kUlad/xiO2WbD1s=; b=Qtlrumt1OhHdAKjyOBf8cwbK9i+S/EzJ3Gk+gw53OULf3rBNFX9pYuVfQT5NzGJOpt F/svVoIc0VfKooi9T2YXKPH+aT1100lWCYIXA1OXvsoDbcqloE5f+oRDI3/RDCcNa2Tt thvSoSN2zJdwdjawSUWlSu/4jV+8tT0AONHC5wFkxplooEt1fZWdo/uyii2B7ZFWtnMx WcxeqiecxyMUvTKsXaTUGwHsScRp+JIwaf28MTrOYGCswNA9dl1hHW/dk6wj+YS9DbjG kbs1CvQlU5awJ1VxAOkmwG831qLyFIC9zsa+VgS/PS21X8N53CXfAQ//IN8POEndCo2P h9EQ== X-Gm-Message-State: AO0yUKW+t6MPDyYI6Wqy2C9/FmNa9F3+pL5bm0WP+O0r5Yuix2dyuW0b bTITWiu5p5W+PogVGF+0aZ4= X-Google-Smtp-Source: AK7set/kTzNgrjLB1SaReMwtJtPzRasEr+UdBaNYSArxa8SWqIsMpzdlmPFd3IY+TdeJwoDXpfHetw== X-Received: by 2002:adf:cc86:0:b0:2c7:a3b:4e76 with SMTP id p6-20020adfcc86000000b002c70a3b4e76mr19102491wrj.6.1678409503253; Thu, 09 Mar 2023 16:51:43 -0800 (PST) Received: from [192.168.0.160] ([170.253.51.134]) by smtp.gmail.com with ESMTPSA id e23-20020a05600c219700b003dd1bd0b915sm1293265wme.22.2023.03.09.16.51.42 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 09 Mar 2023 16:51:42 -0800 (PST) Message-ID: <9f678634-d89c-c6fa-f06c-fbee8c5960bf@gmail.com> Date: Fri, 10 Mar 2023 01:51:33 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: nextafter underflow and errno in Glibc Content-Language: en-US To: Pascal Cuoq , "mtk.manpages@gmail.com" Cc: "linux-man@vger.kernel.org" , Guillaume Cluzel , GNU C Library , Andreas Schwab References: From: Alejandro Colomar In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------Ib508aIGmza2qEAo7GTZm9Zj" X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,KAM_SHORT,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------Ib508aIGmza2qEAo7GTZm9Zj Content-Type: multipart/mixed; boundary="------------23iMuuX5RAEXq4Ly8d5xciPa"; protected-headers="v1" From: Alejandro Colomar To: Pascal Cuoq , "mtk.manpages@gmail.com" Cc: "linux-man@vger.kernel.org" , Guillaume Cluzel , GNU C Library , Andreas Schwab Message-ID: <9f678634-d89c-c6fa-f06c-fbee8c5960bf@gmail.com> Subject: Re: nextafter underflow and errno in Glibc References: In-Reply-To: --------------23iMuuX5RAEXq4Ly8d5xciPa Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hello Pascal, On 3/8/23 19:10, Pascal Cuoq wrote: > Hello, >=20 > in 2008 Michael Kerrisk reported that Glibc's nextafter implementation = did not set errno as it should: >=20 > https://sourceware.org/bugzilla/show_bug.cgi?id=3D6799 >=20 > That bug was marked as =E2=80=9CRESOLVED FIXED=E2=80=9D in 2020 but the= re still exists a disagreement between what the current man page for next= after at https://man7.org/linux/man-pages/man3/nextafter.3.html says, nam= ely: >=20 > If x is not equal to y, and the correct function result would be= > subnormal, zero, or underflow, a range error occurs, and either > the correct value (if it can be represented), or 0.0, is > returned. > =E2=80=A6 > Range error: result is subnormal or underflows > errno is set to ERANGE. An underflow floating-point > exception (FE_UNDERFLOW) is raised. >=20 > =E2=80=A6 and what Glibc's implementation does for nextafter(0., 1.). >=20 > This has been reported by myself in January of 2023: >=20 > https://sourceware.org/bugzilla/show_bug.cgi?id=3D30040 >=20 > As of this writing, the Glibc maintainers' stance appears to be that th= is behavior is intentional because the specification that Glibc intends t= o implement only mandates setting errno when the result is zero, and appa= rently allows setting it or not when the result is 0x1.0p-1074, depending= on whether this value was obtained by going one step up from 0.0 or one = step down from 0x2.0p-1074. >=20 > If the Glibc maintainers do not consider the current behavior a bug, th= en this should be noted somehow in the nextafter man page. Would you please send a patch for the manual page? You can find the guidelines for that here: . You can clone the git repository from here: If you send a patch, please CC the folowing: Cc: Andreas Schwab Cc: Thanks, Alex >=20 > Regards, >=20 > Pascal >=20 --=20 GPG key fingerprint: A9348594CE31283A826FBDD8D57633D441E25BB5 --------------23iMuuX5RAEXq4Ly8d5xciPa-- --------------Ib508aIGmza2qEAo7GTZm9Zj Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEE6jqH8KTroDDkXfJAnowa+77/2zIFAmQKfxUACgkQnowa+77/ 2zKF+A/+KFxfnLCjQkKl6uEUvMZBrpSf/HJ+4cKla77v0oxV+9U6f8vTPDHembsr Tw975dRFfJLzZzB8kQfP/HPtwqXFWDFj0lz9XhcXIXd/o5yBZKDXV4j21vkgEXJY rr87uHC2UFysDdei55rZiRFP5R4/Ot6YfrxwRUM7gc0SWF3bnpD0awqyF/3IoMNt DesSWsQpqtMW35NR78tJBHTYAEzGOm/FMHF+XVMQsKfyv+Ec1/PBJSfm9NcnZzkU loYh3+WZg6Ys6GbmixqKrhybQGwIy9mu5kUVNVLmrmjSmqBzWEkZfeBqb4PKP585 eGKXMvpZcyOXRKC05gtHdP2W069XDHI2n9xjkj9ji8k48BsYv8IpSwXVFlVXNivl mzIbkfbOapcp5e+RYhp/KxYKus7WNK5Kha/6ZvpL+C9ui5UQBObYDbahICfr35m+ eYR4mEZL8EigxyF5v2hqa0uNV0u07MZt4dHjO3O+bSl1lzIjDV3KTXtdceIA/k5B 5m7TwB66JURBmXVnmhFKTopk5YQrsFJCX3mxv1lNWcd5imEq2H4dd7qxfbqxcDo7 +lFVrBufDaAePbdt9krZKheFZnYvbcFf3TeO/CC58HgcPIFSjLZHNeck+WGt9XWK Hr0fY1Q5FLXugM3dgPfwdE7XqSIAZKUus+x2taV/EaMeZid14Yc= =CzTb -----END PGP SIGNATURE----- --------------Ib508aIGmza2qEAo7GTZm9Zj--