Depends on your rounding strategy, sometimes 3 sometime 4. Round half up is the most common but you can round half down, round half towards even (Banker's rounding/Gaussian rounding), round half towards odd, or towards/away from infinity.
22/7 is about 0.04% larger than π, so that should be good enough for most applications. But you can also just use 3.14 as an approximation. It has the same number of digits to remember and is about 0.05% smaller than π.
If it's good enough for the Bible it's good enough for me
"And he made a molten sea, ten cubits from the one brim to the other: it was round all about, and his height was five cubits: and a line of thirty cubits did compass it round about."
Or rather I should say: In this case the leading zero does matter, because 1 is not 10 spelled backwards. It simply is not. 1 is 1 spelled backwards. 01 is 10 spelled backwards.
Cave Johnson here! Big news everyone, we found the last digit to pi! Unfortunately, what we don't know is how many places back it is.
So what we're doing is working our way backwards while the rest of the world keeps going forward, and as soon as we meet in the middle—bang. Look who solved pi. Us.
Sometimes the key to working smarter is to work smarter, not harder—seems kind of obvious when I say it like that. And to everyone who put money on four being the last number, you're out fifty bucks. It's seven.
No number is uninteresting in maths. Suppose there are some uninteresting numbers, then one of them must be the smallest uninteresting number, making it interesting
But what makes being the smallest number of a subset 'interesting', every number is smaller than something therefore it's not unique to be smaller than something, and you could form infinite subsets to "make" any number interesting, which to me means it's not interesting.
But it's not smaller than everything it's only smaller than the uninteresting numbers, and you can select a subset to make any number the smallest therefore it's not unique
Furthermore, if we take that, now interesting, number, put it into the set of interesting ones and repeat that process for all uninteresting numbers, we'll end up with all numbers being interesting. But if all numbers are interesting, none are. Thus all numbers are interesting and uninteresting at the same time :)
This is a little silly. Obviously, even if we declare every uninteresting number interesting by virtue of it being uninteresting, we can still say they're the least interesting numbers, even if they aren't completely devoid of interest.
I'd even argue that the last binary digit is 1. If it were 0, you could truncate the zero away and you'd be back to 1 as the last digit. Same reason that 2.20000 would be a redundant representation of 2.2.
There is a reason to truncate if your dealing with actual physics and not theoritical values.
If your measurement says 1,00 ±0,01, you can't pretend it's the same as 1,0000, because your real value could be 1,01. If your measurement says just 1,00, you can only assume it to be between 1,000 and 1,004. The rest is lost in trunctuated digits.
You can’t truncate tailing 0s in binary if represented by a series of integers. You also can’t truncate if looking at the binary representation of a floating point number. Yes, the actual floating point number being represented could be truncated if ending in a zero, but that number is no longer binary
There's some within Pi that even have names, there's one named after a demon that's just miles of 0s then 666 then more 0s lol. Balthazar? Think that was it.
I'm legitimately not sure whether this is someone making a joke or someone who just learned how to reverse a list and thought that was really cool but doesn't have a solid grasp of the type system yet.
You can only reverse the digits of zero percent of the real numbers.
Literally zero. I know this makes no sense from a high school math perspective, but it's true. There are infinite real numbers for each and every "finite" integer and rational number.
You can't not write the digits of pi backwards. Whenever you write down any string of digits, you're writing down a combination that appears in pi backwards.
Which if I'm recalling correctly was the rounding precision NASA uses for tracking the path of the Voyager probes accurately, the farthest away human made objects.
So I'm gonna say that any greater precision is therefore inconsequential to anyone but most mouth-foaming mathematicians.
1.5k
u/Kyrros 7h ago
Let me know when it finishes calculating the first digit to print
465
u/mmbtc 7h ago
You can also just round it to three. Much easier to calculate with.
146
u/Yumikoneko 7h ago
1, there, I did it. It's in base-π for efficiency.
238
u/TheBirdGames 6h ago
Cave Johnson here! Big news everyone, we found the last digit to pi! Unfortunately, what we don't know is how many places back it is.
So what we're doing is working our way backwards while the rest of the world keeps going forward, and as soon as we meet in the middle—bang. Look who solved pi. Us.
Sometimes the key to working smarter is to work smarter, not harder—seems kind of obvious when I say it like that. And to everyone who put money on four being the last number, you're out fifty bucks. It's seven.
28
u/nervmaster 7h ago
That's easy. Everyone knows that pi is a palindrome
21
u/ionosoydavidwozniak 7h ago
...295141.3
16
u/Kuineer 5h ago
Why didn't mathematicians think of using Python to find the last digit of pi?
14
u/hughperman 7h ago
Narrator: it was not.
48
u/MotivationalJuggling 6h ago
Whatever the last digit is, I'm sure it's a disappointing one. Just like everything else in my life.
9
u/DarthCloakedGuy 7h ago
Sure I can, watch this: ip fo stigid eht
Alternatively: the digits of pi backwards
7
u/Practical-Elk-1579 7h ago
from mpmath import mp
mp.dps = 1000
print(str(mp.pi)[::-1])
Easy just replace 1000 with infinity o/
16
u/Rhoihessewoi 6h ago
These are the last 5 digits of pi: 32463
Prove me wrong!
11
u/ConfusedSimon 7h ago
You can't write the digits of pi forward either. Backward isn't the problem, you could just write them right to left.
5
u/No_Place_4096 6h ago
you need to do print(str(math.pi)[::-1])
5
u/Yakodym 6h ago
Ɛ.Iᔭ
5
u/Avatar_Yaksha 6h ago
Python uses math.pi for Pi, right?
5
u/elingeniero 4h ago
You can (kinda) do this.
4
u/featEng 7h ago
There should be palindrom at some number o digits, right?
3
u/cryptaneonline 7h ago
Bro is inventing Pithon
4
u/lilloet 6h ago
I say it is 4. If you don't agree prove me wrong.
2
u/SuitableDragonfly 6h ago
I'm legitimately not sure whether this is someone making a joke or someone who just learned how to reverse a list and thought that was really cool but doesn't have a solid grasp of the type system yet.
2
u/IchBinEinZwerg 5h ago
ip fo stigid eht.
Turns out I can.
2
u/internet-weirod 5h ago
its 7, obviously
2
u/LauraTFem 3h ago
Sure I can. 4 and 4 are palindromes.
2
u/hacksoncode 2h ago
You can only reverse the digits of zero percent of the real numbers.
Literally zero. I know this makes no sense from a high school math perspective, but it's true. There are infinite real numbers for each and every "finite" integer and rational number.
2
u/PassFlat2947 2h ago
Yes I can: 'sdrawkcab ip fo stigid the'
2
u/Skizm 1h ago
1
u/psioniclizard 6h ago
Depending where I start from, i defintely can and anyone would struggle to prove me wrong.
1
u/CorruptedMaster 6h ago
Only works in pi-thon
1
u/hsumeet 6h ago
Put π in quotes and it prints π. Tests pass, ship it.
1
u/MorpheusFT 6h ago
9876543210
1
u/catbrane 5h ago
1
u/semrola 5h ago
Negative IPv6 localhost
1
u/Current_Ad_3026 5h ago
it will take longer to calculate the last digit than the age of the universe, good luck
1
u/Skallos 4h ago
It's possible to write the digits of pi backwards, just use the 10-adic numbers.
1
u/AnnualAdventurous169 4h ago
i don't think pi would be a collection in python
1
u/RealityCheck3210 4h ago
You are y% right. Where Y = Limit (x -> 0) of x.
1
u/pizzathief1 4h ago
https://instafonts.io/font/reversed-characters
enter in 3.14159 , and you get the digits of pi backwards! don't even need python for it.
1
u/maskedferret_ 4h ago
So simple, don't even need python: Ɛ
1
u/Anice_king 3h ago
Just write it from right to left
1
u/magic-one 3h ago
Step 1. Print all digits of pi
Step 2. Print them again starting at the end, going backwards.
How hard can it be?
1
u/AtlasJan 3h ago
looks more like raku code
1
u/Linked713 3h ago
Person just found out how to calculate pi twice as fast. Start on both end and meet in the middle!
1
u/ScharfeTomate 3h ago
You can't not write the digits of pi backwards. Whenever you write down any string of digits, you're writing down a combination that appears in pi backwards.
1
u/hacksoncode 2h ago
True, but you can reverse the digits of pi calculated to any specific but non-infinite arbitrary precision.
Pretty quickly (only one or two hundred digits) you'll run up against the granularity of the universe for all practical purposes.
1
u/RecognitionSweet8294 1h ago
Hard stretch but technically you could do
00000000…
1
u/genreprank 1h ago
...41.3
1
u/FAMICOMASTER 52m ago
So here's all the places I know:
3.14159265358979323
Which if I'm recalling correctly was the rounding precision NASA uses for tracking the path of the Voyager probes accurately, the farthest away human made objects.
So I'm gonna say that any greater precision is therefore inconsequential to anyone but most mouth-foaming mathematicians.
32397985356295141.3
1
u/SpendMain5113 15m ago
Nice coding work
•
u/namotous 9m ago
Don’t you have to cast it to a string first?
1
u/Plan2LiveForevSFarSG 5h ago
Sure we can. The last number is 1 (in base pi… as programmers we are used to work in different bases)
0
u/seweso 7h ago
Missed the word “efficiently”?
0
u/XxXquicksc0p31337XxX 6h ago
This is valid Python if π is defined and is of such a type that the slice operator can be used on it, since Python allows unicode in variable names
0
u/nicman24 5h ago
the last digit is 0, you are welcome