From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Subject: [PATCH] [gdb/testsuite] Fix pi approximation
Date: Mon, 26 Jan 2026 13:41:12 +0100 [thread overview]
Message-ID: <20260126124112.1400069-1-tdevries@suse.de> (raw)
In gdb.dap/ada-non-ascii/prog.adb, I came across the following:
...
π : Integer := 3; -- The Indiana Approximation.
...
This article [1] explains the background behind the comment: the Indiana pi
bill.
Given that the common interpretation seems to be that the bill implies that
π == 3.2 [2]:
...
The bill ... has been claimed to imply a number of different values for π,
although the closest it comes to explicitly asserting one is the wording "the
ratio of the diameter and circumference is as five-fourths to four", which
would make π = 16⁄5 = 3.2, ... .
...
change the type to float, and set it to 3.2.
Luckily, in this particular case, changing the approximation of π has no
effect, so the test-case still passes :) .
Tested on x86_64-linux.
[1] https://en.wikipedia.org/wiki/Indiana_pi_bill
[2] https://en.wikipedia.org/wiki/Approximations_of_pi#Indiana_bill
---
gdb/testsuite/gdb.dap/ada-non-ascii/prog.adb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gdb/testsuite/gdb.dap/ada-non-ascii/prog.adb b/gdb/testsuite/gdb.dap/ada-non-ascii/prog.adb
index 7853be5eff8..b2885b3759e 100644
--- a/gdb/testsuite/gdb.dap/ada-non-ascii/prog.adb
+++ b/gdb/testsuite/gdb.dap/ada-non-ascii/prog.adb
@@ -16,7 +16,7 @@
with Pack; use Pack;
procedure Prog is
- π : Integer := 3; -- The Indiana Approximation.
+ π : Float := 3.2; -- The Indiana Approximation.
φ : constant := 7; -- Not even close.
begin
Do_Nothing (π'Address); -- BREAK
base-commit: 449035c35f2169e0c690d83f28306275ab7f7463
--
2.51.0
next reply other threads:[~2026-01-26 12:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-26 12:41 Tom de Vries [this message]
2026-02-02 17:29 ` Kevin Buettner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260126124112.1400069-1-tdevries@suse.de \
--to=tdevries@suse.de \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox