NetBSD Problem Report #57184

From www@netbsd.org  Sat Jan 14 18:44:51 2023
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id D8C7D1A923A
	for <gnats-bugs@gnats.NetBSD.org>; Sat, 14 Jan 2023 18:44:50 +0000 (UTC)
Message-Id: <20230114184419.D64961A923B@mollari.NetBSD.org>
Date: Sat, 14 Jan 2023 18:44:19 +0000 (UTC)
From: campbell+netbsd@mumble.net
Reply-To: campbell+netbsd@mumble.net
To: gnats-bugs@NetBSD.org
Subject: awk should support hexadecimal floating-point input like 0x1.23456789abcdefp+123 
X-Send-Pr-Version: www-1.0

>Number:         57184
>Category:       bin
>Synopsis:       awk should support hexadecimal floating-point input like 0x1.23456789abcdefp+123
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Jan 14 18:45:01 +0000 2023
>Originator:     Taylor R Campbell
>Release:        9.2
>Organization:
The NetBSD Flotation
>Environment:
being burned by the paperclip maximizer of capitalism
>Description:
awk supports decimal floating-point input, and hexadecimal floating-point output:

% awk 'BEGIN { OFMT = "%a"; print 1.1102230246251565e-16 }'
0x1p-53

But the hexadecimal notation doesn't work on input:

% awk 'BEGIN { print 0x1p-53 }'
0-53

The hexadecimal floating-point notation is a much clearer way to write many floating-point constants without the deception of decimal approximations.
>How-To-Repeat:
Try to enter hexadecimal floating-point input.
>Fix:
Yes please!

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2023 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.