miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 10 Jan 2012 09:44 PM |
| If you printed 22/7 since it's the same thing as math.pi would it print the same or more numbers? |
|
|
| Report Abuse |
|
|
UFAIL2
|
  |
| Joined: 14 Aug 2010 |
| Total Posts: 6905 |
|
|
| 10 Jan 2012 09:46 PM |
> print(22/7) 3.1428571428571 |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 10 Jan 2012 09:49 PM |
-_-
That makes no sense
Because 22 -- 7
Is pi. It's what the song said too.
|
|
|
| Report Abuse |
|
|
UFAIL2
|
  |
| Joined: 14 Aug 2010 |
| Total Posts: 6905 |
|
|
| 10 Jan 2012 09:53 PM |
| pi goes on forever, it's not going to print millions of digits. |
|
|
| Report Abuse |
|
|
grimm343
|
  |
| Joined: 18 Sep 2008 |
| Total Posts: 2796 |
|
|
| 10 Jan 2012 09:56 PM |
print(22/7 ~= math.pi) >true
22/7 is not equal to pi. :'3 |
|
|
| Report Abuse |
|
|
blockoo
|
  |
| Joined: 08 Nov 2007 |
| Total Posts: 17202 |
|
|
| 10 Jan 2012 10:03 PM |
22/7 is an appoximation; it's not really pi.
pi = 3.1415926535897932384626433832795... |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 10 Jan 2012 10:17 PM |
| Erm really? But it's the closest? |
|
|
| Report Abuse |
|
|
|
| 10 Jan 2012 10:24 PM |
22 / 7 = 3.14285714… pi = 3.14159265…
I see a difference. |
|
|
| Report Abuse |
|
|
|
| 10 Jan 2012 10:29 PM |
I'm just a beginner, but isnt there supposed to be quotes somewhere in that print?
Example:
print "22/7" |
|
|
| Report Abuse |
|
|
|
| 10 Jan 2012 10:35 PM |
No. Saying print("22/7") would literally make it print 22/7. If you don't include the quotation marks, then you get the value of whatever you put in.
Sincerely, Noobertuber |
|
|
| Report Abuse |
|
|
|
| 10 Jan 2012 10:53 PM |
22/7 is not the closest approximation to pi. Also, Lua stores more digits for math.pi than it shows you when you try to print it (or, rather, cast tostring on it): print(tonumber(tostring(math.pi)) == math.pi) --> false |
|
|
| Report Abuse |
|
|
Quenty
|
  |
| Joined: 03 Sep 2009 |
| Total Posts: 9316 |
|
|
| 10 Jan 2012 11:07 PM |
| Uggg. Where are we suppose to memorize 300 million numbers of pie? |
|
|
| Report Abuse |
|
|