X-Loop: help-debbugs@HIDDEN Subject: bug#66256: sorting NAN values with "=?UTF-8?Q?general-numeric=E2=80=99?= Resent-From: Jorge Stolfi <stolfi@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-coreutils@HIDDEN Resent-Date: Thu, 28 Sep 2023 11:16:02 +0000 Resent-Message-ID: <handler.66256.B.169589973525898 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: report 66256 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: 66256 <at> debbugs.gnu.org X-Debbugs-Original-To: bug-coreutils@HIDDEN Received: via spool by submit <at> debbugs.gnu.org id=B.169589973525898 (code B ref -1); Thu, 28 Sep 2023 11:16:02 +0000 Received: (at submit) by debbugs.gnu.org; 28 Sep 2023 11:15:35 +0000 Received: from localhost ([127.0.0.1]:53149 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1qlozV-0006jY-PX for submit <at> debbugs.gnu.org; Thu, 28 Sep 2023 07:15:35 -0400 Received: from lists.gnu.org ([2001:470:142::17]:50292) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <stolfi@HIDDEN>) id 1qloVL-0005lT-EG for submit <at> debbugs.gnu.org; Thu, 28 Sep 2023 06:44:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <stolfi@HIDDEN>) id 1qloV1-0003f6-Dv for bug-coreutils@HIDDEN; Thu, 28 Sep 2023 06:44:03 -0400 Received: from taquaral.ic.unicamp.br ([143.106.7.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <stolfi@HIDDEN>) id 1qloUw-0003tA-IN for bug-coreutils@HIDDEN; Thu, 28 Sep 2023 06:44:00 -0400 Received: from guanabara.ic.unicamp.br (guanabara.ic.unicamp.br [143.106.7.44]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: stolfi) by taquaral.ic.unicamp.br (Postfix) with ESMTPSA id 9E87A27C4E4A for <bug-coreutils@HIDDEN>; Thu, 28 Sep 2023 07:43:53 -0300 (-03) DKIM-Filter: OpenDKIM Filter v2.11.0 taquaral.ic.unicamp.br 9E87A27C4E4A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ic.unicamp.br; s=default; t=1695897833; bh=8tB3IgBNc8GjiSeuBXdJUFpq0xsMsz1hbEihAxExAe0=; h=Date:From:To:Subject:From; b=L4tajBwFnT4gLcOfZht9B43gEUrUChFevaf/1Y+a43a6DJpL7x6yA5T1gNFy57FKN X3PFc2YE/XiWnf/PofrOnpmgsRLytu8Ukvv/+UIDaVibGnOEk4KdhiQgRDgKfRlgGk aJ0wxfPFUwCx+VF/KqWZJH5pyTlpISAIlAHSNl94= Received: from 187-35-195-161.dsl.telesp.net.br (187-35-195-161.dsl.telesp.net.br [187.35.195.161]) by webmail2.ic.unicamp.br (Horde Framework) with HTTPS; Thu, 28 Sep 2023 07:43:52 -0300 Date: Thu, 28 Sep 2023 07:43:52 -0300 Message-ID: <20230928074352.Horde.e6lnpeLVHKt8TsI8KnyEFB1@HIDDEN> From: Jorge Stolfi <stolfi@HIDDEN> User-Agent: Horde Application Framework 5 Content-Type: text/plain; charset=utf-8; format=flowed; DelSp=Yes MIME-Version: 1.0 Content-Disposition: inline Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=143.106.7.43; envelope-from=stolfi@HIDDEN; helo=taquaral.ic.unicamp.br X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.9 (/) X-Mailman-Approved-At: Thu, 28 Sep 2023 07:15:28 -0400 X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -0.1 (/) The full documentation of the "--general-numeric-sort" option of {sort} says that NaN values are sorted "in a consistent but machine-dependent order". This is not good. The point of the IEEE floating-point standard was to make the results of floating-point computations be independent of the platform or implementation. Please consider extending that goal to the handling of NaNs by {sort}. That it, all flavors of NaN (determined by their char tails, as parsed by {strtod}) should be treated as equal. The fact that different flavors of NaN have distinct binary representation is not an excuse to sort them as distinct, since the same is true of +0 and -0, which "general-numeric" sort already treats as equal. As a separate suggestion, please consider having {sort} abort with an error message if any field that is supposed to be sorted with "general-numeric" is not a valid {double} value, or has some leftover chars that are not parsed by {strtod}. Whether these solutions are accepted or not, please change the manpage explanation of "-g"/"--general-numeric-sort" to say, at least, "the field is parsed as a double-precision (64-bit) floating-point number and sorted by its numeric value". Thanks, and all the best, --jorge -- Jorge Stolfi - Professor Titular/Full Professor Instituto de Computação/Computer Science Dept Universidade Estadual de Campinas/State University of Campinas Campinas, SP - Brazil
Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) Content-Type: text/plain; charset=utf-8 X-Loop: help-debbugs@HIDDEN From: help-debbugs@HIDDEN (GNU bug Tracking System) To: Jorge Stolfi <stolfi@HIDDEN> Subject: bug#66256: Acknowledgement (sorting NAN values with "=?UTF-8?Q?general-numeric=E2=80=99?=) Message-ID: <handler.66256.B.169589973525898.ack <at> debbugs.gnu.org> References: <20230928074352.Horde.e6lnpeLVHKt8TsI8KnyEFB1@HIDDEN> X-Gnu-PR-Message: ack 66256 X-Gnu-PR-Package: coreutils Reply-To: 66256 <at> debbugs.gnu.org Date: Thu, 28 Sep 2023 11:16:02 +0000 Thank you for filing a new bug report with debbugs.gnu.org. This is an automatically generated reply to let you know your message has been received. Your message is being forwarded to the package maintainers and other interested parties for their attention; they will reply in due course. Your message has been sent to the package maintainer(s): bug-coreutils@HIDDEN If you wish to submit further information on this problem, please send it to 66256 <at> debbugs.gnu.org. Please do not send mail to help-debbugs@HIDDEN unless you wish to report a problem with the Bug-tracking system. --=20 66256: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D66256 GNU Bug Tracking System Contact help-debbugs@HIDDEN with problems
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd,
1994-97 Ian Jackson.