Qbasicnews.com
July 03, 2020, 09:26:11 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Back to Qbasicnews.com | QB Online Help | FAQ | Chat | All Basic Code | QB Knowledge Base
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: ah, pi.  (Read 1688 times)
Agamemnus
x/ \z
*****
Posts: 3491



« on: May 22, 2003, 10:32:17 PM »

I made my pi formula at http://www.geocities.com/pisforpi/ into a program.

CLS
n% = 21
IF n% = 0 THEN SYSTEM
j# = 0
FOR I% = 1 TO n% - 1
j# = (2 + j#) ^ .5
NEXT I%
j# = (2 - j#) ^ .5 * 2 ^ n%
PRINT j#
Logged

Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."

Visit www.neobasic.net to see rubbish in all its finest.
Ninkazu
Been there, done that
*****
Posts: 1169



WWW
« Reply #1 on: May 22, 2003, 10:41:24 PM »

Wrong.

Pi is:
3.1415926535897932384626433832...

All of that from my memory Tongue

::EDIT::
pi# = 4 * ATAN(1)
Logged

am an asshole. Get used to it.
Agamemnus
x/ \z
*****
Posts: 3491



« Reply #2 on: May 22, 2003, 11:06:33 PM »

Rounding error. Try n = 16.
Logged

Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."

Visit www.neobasic.net to see rubbish in all its finest.
BinarySHOCK
Forum Regular
**
Posts: 117



WWW
« Reply #3 on: May 23, 2003, 04:08:23 AM »

hmm here's a way i just thought of

Pi# = COS(2) * -7.5492358222#
Print Pi#

altho it's slightly inaccurate, but heh it's original Tongue
Logged

very F***ing song remains the same
To everyone who sucks-up for the fame
Out of strength you know we speak the truth
Every trend that dies is living proof

MasterMinds Software
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!