ChatGPT has calculated the last digit of Pi (maybe)

purbeast0

No Lifer
Sep 13, 2001
53,454
6,300
126
The problem with that code block, is that it doesn't calculate the last number of pi at all.

It has a string representing pi. By definition of a string in code if you are declaring it like that, it has to have finite characters.

All that code is doing it telling you the last character in a string it defines.

It's a stupid code block that does nothing really.
 
  • Like
Reactions: mxnerd

burninatortech4

Senior member
Jan 29, 2014
713
392
136
The problem with that code block, is that it doesn't calculate the last number of pi at all.

It has a string representing pi. By definition of a string in code if you are declaring it like that, it has to have finite characters.

All that code is doing it telling you the last character in a string it defines.

It's a stupid code block that does nothing really.

So, this is a nothing burger?
 

Jon-T

Senior member
Jun 5, 2011
518
329
136
I always thought pi was infinite? Kinda like dividing 1 by 3 is 0.333333.... and it does not actually end.

Only in our present (flawed) counting system.

In the new realm of physics and math called Terryology, ChatGTP is totally logical
 

BudAshes

Lifer
Jul 20, 2003
13,968
3,293
146
Maybe some people are impressed with an AI telling you the last character of a string it created?

Even the OP knew this was a joke. Anyone here could review that code in 2 seconds and realize it's an "AI" code fart.
 
  • Haha
Reactions: JEDI

Red Squirrel

No Lifer
May 24, 2003
69,690
13,325
126
www.betteroff.ca
The fact that it can generate code that is semi proper is still quite impressive though. I have not actually gotten around to playing around with it, but I might have to. I wonder if you can actually feed it code and then ask it to make a change or to look for a bug or security issue or what not. I might have to play around with that.
 

Red Squirrel

No Lifer
May 24, 2003
69,690
13,325
126
www.betteroff.ca
I finally got around to making an account and playing around with it. I can see people using this for coding homework. I made some code that crash intermittently and it was able to figure out why. It was rather simple so in theory a syntax checker that checks for this sort of thing could probably catch that, but considering it's AI doing it and not just a purpose built tool it's still pretty cool.
 
  • Like
Reactions: igor_kavinski

Muse

Lifer
Jul 11, 2001
39,905
9,601
136
I always thought pi was infinite? Kinda like dividing 1 by 3 is 0.333333.... and it does not actually end.
Yeah, and I'm pretty sure this can be proven mathematically. Pi is not a rational number and therefore has no last decimal digit.
 

snoopy7548

Diamond Member
Jan 1, 2005
8,211
5,272
146
I guess if you think about it, the last digit of Pi is a number between 0 and 9.
 

Red Squirrel

No Lifer
May 24, 2003
69,690
13,325
126
www.betteroff.ca
Dave from EEVblog tries to get ChatGPT to write code and it's actually pretty impressive what it can do. I don't think it's actually replacing programmers any time soon but it can definitely aid in doing some of the more tedious part of getting a program started. There is also a certain art in coming up with the right syntax of what to ask of it. Actually pretty impressive as it still worked like 95%.