Menu

#1 digit error/mismatch at -s 9999 -n 20, in the 10th of the 20 digits shown

1.0
open
nobody
None
2015-05-23
2015-05-23
pryrt
No

There appears that the c program can output errors in the 10th digit:

C:>head --bytes=10000 pi-hex.1000000.txt | tail --bytes=50
F169B5F18A8C73EE0B5E57368F6C7AF4BB7A595926AAB49EC6

These match http://www.numberworld.org/digits/Pi/, in the row labled "10_000", so I know it's a reasonable file

C:>pi-in-hex.exe -s 9950 -n 50
F169B5F18A8C73EE0B5E57368F6C79F4BB7A595926AAB49EC6

these match your text file, or the numberworld site, so I know your algorithm is reasonably implemented

C:>pi-in-hex.exe -s 9990 -n 50
26AAB49EC68AC8FCFB8016CBDB8BBC1F476982C71185C7DA7A

the first ten digits of -s 9990 line up with the last 10 in -s 9950, so that's good

But if I run a bunch, incrementing start by 1 each time:

C:>pi-in-hex.exe -s 9991 -n 20
C:>pi-in-hex.exe -s 9992 -n 20
C:>pi-in-hex.exe -s 9993 -n 20
C:>pi-in-hex.exe -s 9994 -n 20
C:>pi-in-hex.exe -s 9995 -n 20
C:>pi-in-hex.exe -s 9996 -n 20
C:>pi-in-hex.exe -s 9997 -n 20
C:>pi-in-hex.exe -s 9998 -n 20
C:>pi-in-hex.exe -s 9999 -n 20
C:>pi-in-hex.exe -s 10000 -n 20

And then line up the digits

26AAB49EC68AC8FCFB80
.6AAB49EC68AC8FCFB801
..AAB49EC68AC8FCFB8016
...AB49EC68AC8FCFB8016C
....B49EC68AC8FCFB8016CB
.....49EC68AC8FCFB8016CBD
......9EC68AC8FCFB8016CBDB
.......EC68AC8FCFB8016CBDB8
........C68AC8FCFB8016CBDB8B
.........68AC8FCFB7016CBDB8BB
..................^...........      ERROR at -s 9999 in the 10th hex digit
..........8AC8FCFB8016CBDB8BBC

C:>head --bytes=10020 pi-hex.1000000.txt | tail --bytes=30
26AAB49EC68AC8FCFB8016CBDB8BBC

Since most are 8 in that digit, I believe the 8, not the 7.

I am new to spigot algorithms (I found your program when my attempt at a BPP digit extractor didn't work), but from what I can tell, the digit extraction does not guarantee all the digits from the fraction you generate; just the first few... I think doing step sizes of 10 might be pushing the accuracy too much.

Discussion


Log in to post a comment.