]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[gdb/testsuite] Fix pi approximation
authorTom de Vries <tdevries@suse.de>
Mon, 2 Feb 2026 18:22:51 +0000 (19:22 +0100)
committerTom de Vries <tdevries@suse.de>
Mon, 2 Feb 2026 18:22:51 +0000 (19:22 +0100)
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.

Approved-by: Kevin Buettner <kevinb@redhat.com>
[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

index 7853be5eff8b110cfbba21b3319529639babc4ec..b2885b3759e9bd7636bf3316f072452ed9b5adc1 100644 (file)
@@ -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