Results 1 to 37 of 37

Thread: Pi

  1. #1
    appi101
    Guest

    Pi

    Hi

    How can we find the value of pi in VB

    Appi.

  2. #2
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Pi is not a built in constant, you can declare it like this:

    Const pi As Double = 3.14159265358979
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  3. #3
    appi101
    Guest
    HI

    I meant How to keep on getting more and more accurate values of pi, like computing it to say 1 million places of decimal

  4. #4
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    atn(1)*4 gives pi, and arcus tangens can be written as a series:

    atn(x) = x - x^3/3+x^5/5-x^7/7...

    therefore

    pi = sumof( 4/(n*4-3)-4/(n*4-1))

    you just need to work out the operations on say a byte array, because there's no huge datatype. You need addition, substraction and division.
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  5. #5
    Frenzied Member nishantp's Avatar
    Join Date
    Jan 2001
    Location
    Where you least expect me to be
    Posts
    1,375
    I cant imagine what use you would have for Pi calculated to 1000000 decimals, however if all you want to do is calculate it...then you should know its been done and is probably available on the internet.
    You just proved that sig advertisements work.

  6. #6
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    for fun
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  7. #7
    Frenzied Member
    Join Date
    Jul 1999
    Posts
    1,800
    22/7

  8. #8
    Frenzied Member nishantp's Avatar
    Join Date
    Jan 2001
    Location
    Where you least expect me to be
    Posts
    1,375
    You could hard code a division functions that uses human techniques (long-division) and return a string. Technically you could return about (2^64) -2 decimals...it might take a while though
    You just proved that sig advertisements work.

  9. #9
    Frenzied Member HarryW's Avatar
    Join Date
    Jan 2000
    Location
    Heiho no michi
    Posts
    1,827
    Pi is an irrational number so simply finding the decimal representation of a fraction isn't what needs to be done.

    I don't actually know what the formal mathematical definition of Pi is, other than it being the ratio of a circle's diameter to its circumference. Kedaman's sum of a converging series looks probable though.
    Harry.

    "From one thing, know ten thousand things."

  10. #10
    Frenzied Member HarryW's Avatar
    Join Date
    Jan 2000
    Location
    Heiho no michi
    Posts
    1,827
    Oh, and incidentally, if I was doing this I'd use Python for its built-in long datatype which is only limited in size by the amount of RAM you have plus virtual memory (string representation of the number).

    If you're doing it in VB you may have to code an extra long datatype yourself.
    Harry.

    "From one thing, know ten thousand things."

  11. #11
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    What kind of operations can you do on the long datatype?
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  12. #12
    Frenzied Member nishantp's Avatar
    Join Date
    Jan 2001
    Location
    Where you least expect me to be
    Posts
    1,375
    Well if all you want is the value of 22/7 to a LOT of decimals (dont see the point) this would work. Its crude, but it works fine.
    VB Code:
    1. Function LongDivision(ByVal Num As Long, ByVal Den As Long, ByVal Decimals As Long) As String
    2. Dim i As Long
    3. Dim Dec1 As Long
    4. Dim Dec3 As Long
    5. Dim StrOut As String
    6. Dim DecimalAdd As Boolean
    7. For i = 1 To Decimals
    8.     Dec1 = Int(Num / Den)
    9.     StrOut = StrOut & Dec1
    10.     If Not DecimalAdd Then
    11.         StrOut = StrOut & "."
    12.         DecimalAdd = True
    13.     End If
    14.     Dec3 = (Num - (Dec1 * Den)) * 10
    15.     Num = Dec3
    16. Next
    17. LongDivision = StrOut
    18. End Function
    This can technically return up to (2^64) -2 decimals...but i dont suggest trying that...
    You just proved that sig advertisements work.

  13. #13
    Frenzied Member HarryW's Avatar
    Join Date
    Jan 2000
    Location
    Heiho no michi
    Posts
    1,827
    Ked, you can do whatever you like with it really. Just treat it as a normal integer. Might be a little slower obviously.
    Harry.

    "From one thing, know ten thousand things."

  14. #14
    Frenzied Member nishantp's Avatar
    Join Date
    Jan 2001
    Location
    Where you least expect me to be
    Posts
    1,375
    Originally posted by HarryW
    Oh, and incidentally, if I was doing this I'd use Python for its built-in long datatype which is only limited in size by the amount of RAM you have plus virtual memory (string representation of the number).

    If you're doing it in VB you may have to code an extra long datatype yourself.
    Where is the Python available? Like is it free?
    You just proved that sig advertisements work.

  15. #15
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    obviously it could be a lot slower, one cpu instruction for a regular 32bit integer addition, 20 or more for 64
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  16. #16
    New Member
    Join Date
    Aug 2001
    Location
    switzerland
    Posts
    4
    Slightly off topic (and I did register just to post this! tells something about my personality )

    WARNING: Do NOT calculate Pi in binary. It is conjectured that this number is normal, meaning that it contains ALL finite bit strings.

    If you compute it, you will be guilty of:

    Copyright infringement (of all books, all short stories, all newspapers, all magazines, all web sites, all music, all movies, and all software, including the complete Windows source code)

    Trademark infringement

    Possession of child pornography

    Espionage (unauthorized possession of top secret information)

    Possession of DVD-cracking software

    Possession of threats to the President

    Possession of everyone's SSN, everyone's credit card numbers, everyone's PIN numbers, everyone's unlisted phone numbers, and everyone's passwords

    Defaming Islam. Not technically illegal, but you'll have to go into hiding along with Salman Rushdie.

    Defaming Scientology. Which IS illegal -- just ask Keith Henson.

    Also, your computer will contain all of the nastiest known computer viruses. In fact, all of the nastiest POSSIBLE computer viruses.

    Some of the files on my PC are intensely personal, and I for one don't want you snooping through a copy of them.

    You might get away with computing just a few digits, but why risk it? There's no telling how far into Pi you can go without finding the secret documents about the JFK assassination, a photograph of your neighbor's six year old daughter doing the nasty with the family dog, or a complete copy of the not-yet-released Pearl Harbor movie. So just don't do it.

    The same warning applies to e, the square root of 2, Euler's constant, Phi, the cosine of any non-zero algebraic number, and the vast majority of all other real numbers.

    There's a reason why these numbers are always computed and shown in decimal, after all.

    [(c) ? sorry, from the depths of the net, and there was no author given when I got it]

  17. #17
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    There is no information without a context.

    btw, if i could find the decimal indexes for all the mp3's I have, that would be a rather huger format to store them in.
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  18. #18
    appi101
    Guest
    So how will we calculate the value of pi, to say 10 million places of decimal. What do you mean work on a byte array, and how do we find the sumof( 4/(n*4-3)-4/(n*4-1)) and how do we find it. I am new to this kind of math and processing this kind of math.

    When I use a for loop like this
    dim a as double, b as double
    a = 1
    For i = 2 To 1000000
    b = (-1) ^ i
    a = a - b / i
    Next i

    where a = pi/4 (the series pi/4=1-1/3+1/5-1/7----) I just get the value till some 7-10 places of decimal. How do I increase it.

    Appi

  19. #19
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    You can't, because there's no support for that in vb. The decimal datatype is the biggest integer datatype and it is extreemly slow. There should be a thread somewhere around in chitchat in which some algoritms was made to handle huge integers
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  20. #20
    Frenzied Member HarryW's Avatar
    Join Date
    Jan 2000
    Location
    Heiho no michi
    Posts
    1,827
    Python is completely free and is commonly used by scientists for this kind of stuff, although you wouldn't want to use it for anything performance-critical like calculating pi to however many billion decimal places. It would be fine for calculating to a few thousand or something though.

    You can get the latest version (Python 2.1) from www.python.org

    Also has a built-in complex datatype if you need it.
    Harry.

    "From one thing, know ten thousand things."

  21. #21
    appi101
    Guest
    Hi

    I'll search around the forums. Maybe I find something.

    Thanks for the help

    Appi

  22. #22
    DaoK
    Guest
    VB Code:
    1. Pi = 3.141592551104866223558431126381048812355898112276391048823661691
    2. 12648104891237105711355110577023712221136511058672371277113652105
    3. 86823713861136671058762371496113682105891237171611369410589123723
    4. 75113696105806987498576984769847609873409867439857694387569803475
    5. 28937465283974658927364587923645897236458723645987236859742365298
    6. 76458726345897623897465283746587293465897236458726458972436952384
    7. 92322547392938475623987562897465298376598726549872365987236598726
    8. 87968197871987261987618719876187632198716239874168971236489761238
    9. 97641238976143298761911010101032178648764387263874687638763286234
    10. 23189432943213458745984753489760975645784326574365743256743657432
    11. 65743256743265743276543265743265743268743268743268743268732468742
    12. 38763468727364872364872634872634876238476287346872164872648726348
    13. 71623487216348762138746218764318726348712634876123876482173647126
    14. 34872163487621387462873647213648271364872136487126348726487126387
    15. 62487263847623876418276348716234871623874682734687126348721634872
    16. 61873461287364871263487126348761238746128736418732648712648754354
    17. 39875438935409453809543805349854309854309801010101029389813287243
    18. 87634287643287648723648762384762387462873648726348726348726348726
    19. 34876234876238746328746238764827364827346282828736482764828238723
    20. 76464626237646273462876482736487263487263487263486243876234873264
    21. 67843114691106720238467811469810672123847881147001067212385008114
    22. 72210672123853371147321067212385447114742106721238566711475010672
    23. 12385887114751106722238599611476810672323865461147691067242386656
    24. 11481410676923874241148341067892387534114835106790238819311483910
    25. 67902388303114843106790238863311484810679123895671148511067942389
    26. 62111485210679523897311148571067962389841114865106796239011611488
    27. 51067962390171114897106796239050011492110679623906101149271067962
    28. 39313711502410688123932471150251068822395883115036106892239599311
    29. 50371068932397641115052106899239764111505310690024121411153411071
    30. 72241230611550410733524124151155171073392412800115523107345241291
    31. 01155771073562413020115578107357241334911559810737524135691156001
    32. 07377241549111571610749324155461157171074942420489115728107498224
    33. 12306115504107335241241511551714600106719238292111460610671923830
    34. 30114634106719238314011465010671923836901146521067192383909114654
    35. 10671923841291146661067192384349114676106719238445911469010671923
    36. 84568114691106720238467811469810672123847881147001067212385008114
    37. 72210672123853371147321067212385447114742106721238566711475010672
    38. 12385887114751106722238599611476810672323865461147691067242386656
    39. 11481410676923874241148341067892387534114835106790238819311483910
    40. 67902388303114843106790238863311484810679123895671148511067942389
    41. 62111485210679523897311148571067962389841114865106796239011611488
    42. 51067962390171114897106796239050011492110679623906101149271067962
    43. 39313711502410688123932471150251068822395883115036106892239599311
    44. 50371068932397641115052106899239764111505310690024121411153411071
    45. 72241230691237270511370010589323733641137241058942373474113726105
    46. 89423736931137361058942374023113750105894237616511386910601223803
    47. 39114418106555238044911452010665723806141145361066692380724114550
    48. 10668123810531145621066812381273114564106683238182211458110670023
    49. 82481114587106706238259111460010671923829211146061067192383030114
    50. 63410671923831401146501067192383690114652106719238390911465410671
    51. 92384129114666106719238434911467610671923844591146901067192384568
    52. 91237270511370010589323733641137241058942373474113726105894237369
    53. 31137361058942374023113750105894237616511386910601223803391144181
    54. 06555238044911452010665723806141145361066692380724114550106681238
    55. 10531145621066812381273114564106683238182211458110670023824811145
    56. 87106706238259111460010671923829211146061067192383030114634106719
    57. 23831401146501067192383690114652106719238390911465410671923841291
    58. 49853984759837459837498573984758324759254786324785698788881466610
    59. 45457634875634876532765978659872364598723645987264598723645987326
    60. 45987632498756328974652389746598372645987364598736459876324987562
    61. 39874653987465298376459873264589763249875632984765239874659873264
    62. 59873264598762348756239847653298746582376458972364587263485976328
    63. 76984357693845769384075698347569843756912365231047256148752198769
    64. 87987787985764398787694123765423764587349060670984587567263579879
    65. 12316564765230987098347654874869346426765476547858435435435643543
    66. 89423736931137361058942374023113750105894237616511386910601223803
    67. 39114418106555238044911452010665723806141145361066692380724114550
    68. 10668123810531145621066812381273114564106683238182211458110670023
    69. 82481114587106706238259111460010671923829211146061067192383030114
    70. 63410671923831401146501067192383690114652106719238390911465410671
    71. 92384129114666106719238434911467610671923844591146901067192384568
    72. 91237270511370010589323733641137241058942373474113726105894237369
    73. 31137361058942374023113750105894237616511386910601223803391144181
    74. 06555238044911452010665723806141145361066692380724114550106681238
    75. 10531145621066812381273114564106683238182211458110670023824811145
    76. 87106706238259111460010671923829211146061067192383030114634106719
    77. 23831408753984759874598374598374598374597349587349857398475938475
    78. 98374598371146501067192383690114652106719238390911465410671923841
    79. 29114666106715983759837495873498573984983609850968409586094586094
    80. 85069892384349114676106719238445911469010671923845682349691112621
    81. 10486622355843112638104881235589811263910488236616911264810489123
    82. 71057113551105770237122211365110586723712771136521058682371386113
    83. 66710587623714961136821058912371716113694105891237237511369610589
    84. 48573874659827645873645897326589763245897623489756389746538746538
    85. 74652987346592873645987236459872634985763294857629387465923846593
    86. 92322547392938475623987562897465298376598726549872365987236598726
    87. 87968197871987261987618719876187632198716239874168971236489761238
    88. 56435435435435435432143214332144521321213542154343521354213542134
    89. 72210672123853371147321067212385447114742106721238566711475010672
    90. 12385887114751106722238599611476810672323865461147691067242386656
    91. 11481410676923874241148341067892387534114835106790238819311483910
    92. 67902388303114843106790238863311484810679123895671148511067942389
    93. 62111485210679523897311148571067962389841114865106796239011611488
    94. 51067962390171114897106796239050011492110679623906101149271067962
    95. 39313711502410688123932471150251068822395883115036106892239599311
    96. 50371068932397641115052106899239764111505310690024121411153411071
    97. 72241230691237270511370010589323733641137241058942373474113726105
    98. 89423736931137361058942374023113750105894237616511386910601223803
    99. 39114418106555238044911452010665723806141145361066692380724114550
    100. 10668123810531145621066812381273114564106683238182211458110670023
    101. 82481114587106706238259111460010671923829211146061067192383030114
    102. 63410671923831401146501067192383690114652106719238390911465410671
    103. 92384129114666106719238434911467610671923844591146901067192384568
    104. 91237270511370010589323733641137241058942373474113726105894237369
    105. 31137361058942374023113750105894237616511386910601223803391144181
    106. 06555238044911452010665723806141145361066692380724114550106681238
    107. 10531145621066812381273114564106683238182211458110670023824811145
    108. 87106706238259111460010671923829211146061067192383030114634106719
    109. 23831408753984759874598374598374598374597349587349857398475938475
    110. 98374598371146501067192383690114652106719238390911465410671923841
    111. 29114666106715983759837495873498573984983609850968409586094586094
    112. 85069892384349114676106719238445911469010671923845682349691112621
    113. 10486622355843112638104881235589811263910488236616911264810489123
    114. 71057113551105770237122211365110586723712771136521058682371386113
    115. 66710587623714961136821058912371716113694105891237237511369610589
    116. 48573874659827645873645897326589763245897623489756389746538746538
    117. 74652987346592873645987236459872634985763294857629387465923846593
    118. 24589234503245234534850234578320467045608574976485976409567045607
    119. 46507546094675049857640567840956784098576498759870937097098127980
    120. 17981789237498275409834709210910983175483750983720072789023487957
    121. 84570983745098746580976543789654379863457980657980564379865437980
    122. 63409857643098567809654370986543789654379865347980654379863450987
    123. 63049857609834576098347569083475609873450986734098576039845769084
    124. 35760984576098347560987435908674530987603948576098435760983457609
    125. 83475609834709687430986743098576943058760984357609834576098437560
    126. 98435760984756983475609843756984357690856098760980910910982310948
    127. 02938409321840928340921830941803980198409218430910930943218094321
    128. 80943210984320983420984398065890896048906490842853280981098210943
    129. 6654387653487645876348576348576348756384765387465837

  23. #23
    DaoK
    Guest

  24. #24
    PowerPoster sail3005's Avatar
    Join Date
    Oct 2000
    Location
    Chicago, IL, USA
    Posts
    2,340
    warning though. It takes hours to calculate it to just say the 30th decimal place. I have done it before, so i doubt you are gonna get to 10,000,000.

    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA

  25. #25
    appi101
    Guest
    Hi

    HOw will we do that in VB

    APpi

  26. #26
    PowerPoster sail3005's Avatar
    Join Date
    Oct 2000
    Location
    Chicago, IL, USA
    Posts
    2,340
    do what in VB? Calculate pi?

    Use the series that kedaman posted above. There are other ways, but a series is probably the best.

    I say calculating PI should be left to the super computers, and not VB though.

    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA

  27. #27
    appi101
    Guest
    Hi

    How will we calculate pi in VB using that series>

    Appi

  28. #28
    Frenzied Member mlewis's Avatar
    Join Date
    Sep 2000
    Posts
    1,226
    FORGET IT!!!!!!! It will take you literal days to get to say 5000 digits; 10million is impossible with VB; it would take you until the world explodes from all of the dinosaur crap in the core. Which will never happen cuz dinosaurs are extinct...perhaps they will be resurected, but it will take a while...
    M. Lewis
    Pi-Q Software
    How many mouse clicks does it take to cook breakfast?

    Blargh! I am dead!

  29. #29
    PowerPoster sail3005's Avatar
    Join Date
    Oct 2000
    Location
    Chicago, IL, USA
    Posts
    2,340
    Pi = 3.141592551104866223558431126381048812355898112276391048823661691
    12648104891237105711355110577023712221136511058672371277113652105
    86823713861136671058762371496113682105891237171611369410589123723
    75113696105806987498576984769847609873409867439857694387569803475
    28937465283974658927364587923645897236458723645987236859742365298
    76458726345897623897465283746587293465897236458726458972436952384
    92322547392938475623987562897465298376598726549872365987236598726
    87968197871987261987618719876187632198716239874168971236489761238
    97641238976143298761911010101032178648764387263874687638763286234
    23189432943213458745984753489760975645784326574365743256743657432
    65743256743265743276543265743265743268743268743268743268732468742
    38763468727364872364872634872634876238476287346872164872648726348
    71623487216348762138746218764318726348712634876123876482173647126
    34872163487621387462873647213648271364872136487126348726487126387
    62487263847623876418276348716234871623874682734687126348721634872
    61873461287364871263487126348761238746128736418732648712648754354
    39875438935409453809543805349854309854309801010101029389813287243
    87634287643287648723648762384762387462873648726348726348726348726
    34876234876238746328746238764827364827346282828736482764828238723
    76464626237646273462876482736487263487263487263486243876234873264
    67843114691106720238467811469810672123847881147001067212385008114
    72210672123853371147321067212385447114742106721238566711475010672
    12385887114751106722238599611476810672323865461147691067242386656
    11481410676923874241148341067892387534114835106790238819311483910
    67902388303114843106790238863311484810679123895671148511067942389
    62111485210679523897311148571067962389841114865106796239011611488
    51067962390171114897106796239050011492110679623906101149271067962
    39313711502410688123932471150251068822395883115036106892239599311
    50371068932397641115052106899239764111505310690024121411153411071
    72241230611550410733524124151155171073392412800115523107345241291
    01155771073562413020115578107357241334911559810737524135691156001
    07377241549111571610749324155461157171074942420489115728107498224
    12306115504107335241241511551714600106719238292111460610671923830
    30114634106719238314011465010671923836901146521067192383909114654
    10671923841291146661067192384349114676106719238445911469010671923
    84568114691106720238467811469810672123847881147001067212385008114
    72210672123853371147321067212385447114742106721238566711475010672
    12385887114751106722238599611476810672323865461147691067242386656
    11481410676923874241148341067892387534114835106790238819311483910
    67902388303114843106790238863311484810679123895671148511067942389
    62111485210679523897311148571067962389841114865106796239011611488
    51067962390171114897106796239050011492110679623906101149271067962
    39313711502410688123932471150251068822395883115036106892239599311
    50371068932397641115052106899239764111505310690024121411153411071
    72241230691237270511370010589323733641137241058942373474113726105
    89423736931137361058942374023113750105894237616511386910601223803
    39114418106555238044911452010665723806141145361066692380724114550
    10668123810531145621066812381273114564106683238182211458110670023
    82481114587106706238259111460010671923829211146061067192383030114
    63410671923831401146501067192383690114652106719238390911465410671
    92384129114666106719238434911467610671923844591146901067192384568
    91237270511370010589323733641137241058942373474113726105894237369
    31137361058942374023113750105894237616511386910601223803391144181
    06555238044911452010665723806141145361066692380724114550106681238
    10531145621066812381273114564106683238182211458110670023824811145
    87106706238259111460010671923829211146061067192383030114634106719
    23831401146501067192383690114652106719238390911465410671923841291
    49853984759837459837498573984758324759254786324785698788881466610
    45457634875634876532765978659872364598723645987264598723645987326
    45987632498756328974652389746598372645987364598736459876324987562
    39874653987465298376459873264589763249875632984765239874659873264
    59873264598762348756239847653298746582376458972364587263485976328
    76984357693845769384075698347569843756912365231047256148752198769
    87987787985764398787694123765423764587349060670984587567263579879
    12316564765230987098347654874869346426765476547858435435435643543
    89423736931137361058942374023113750105894237616511386910601223803
    39114418106555238044911452010665723806141145361066692380724114550
    10668123810531145621066812381273114564106683238182211458110670023
    82481114587106706238259111460010671923829211146061067192383030114
    63410671923831401146501067192383690114652106719238390911465410671
    92384129114666106719238434911467610671923844591146901067192384568
    91237270511370010589323733641137241058942373474113726105894237369
    31137361058942374023113750105894237616511386910601223803391144181
    06555238044911452010665723806141145361066692380724114550106681238
    10531145621066812381273114564106683238182211458110670023824811145
    87106706238259111460010671923829211146061067192383030114634106719
    23831408753984759874598374598374598374597349587349857398475938475
    98374598371146501067192383690114652106719238390911465410671923841
    29114666106715983759837495873498573984983609850968409586094586094
    85069892384349114676106719238445911469010671923845682349691112621
    10486622355843112638104881235589811263910488236616911264810489123
    71057113551105770237122211365110586723712771136521058682371386113
    66710587623714961136821058912371716113694105891237237511369610589
    48573874659827645873645897326589763245897623489756389746538746538
    74652987346592873645987236459872634985763294857629387465923846593
    92322547392938475623987562897465298376598726549872365987236598726
    87968197871987261987618719876187632198716239874168971236489761238
    56435435435435435432143214332144521321213542154343521354213542134
    72210672123853371147321067212385447114742106721238566711475010672
    12385887114751106722238599611476810672323865461147691067242386656
    11481410676923874241148341067892387534114835106790238819311483910
    67902388303114843106790238863311484810679123895671148511067942389
    62111485210679523897311148571067962389841114865106796239011611488
    51067962390171114897106796239050011492110679623906101149271067962
    39313711502410688123932471150251068822395883115036106892239599311
    50371068932397641115052106899239764111505310690024121411153411071
    72241230691237270511370010589323733641137241058942373474113726105
    89423736931137361058942374023113750105894237616511386910601223803
    39114418106555238044911452010665723806141145361066692380724114550
    10668123810531145621066812381273114564106683238182211458110670023
    82481114587106706238259111460010671923829211146061067192383030114
    63410671923831401146501067192383690114652106719238390911465410671
    92384129114666106719238434911467610671923844591146901067192384568
    91237270511370010589323733641137241058942373474113726105894237369
    31137361058942374023113750105894237616511386910601223803391144181
    06555238044911452010665723806141145361066692380724114550106681238
    10531145621066812381273114564106683238182211458110670023824811145
    87106706238259111460010671923829211146061067192383030114634106719
    23831408753984759874598374598374598374597349587349857398475938475
    98374598371146501067192383690114652106719238390911465410671923841
    29114666106715983759837495873498573984983609850968409586094586094
    85069892384349114676106719238445911469010671923845682349691112621
    10486622355843112638104881235589811263910488236616911264810489123
    71057113551105770237122211365110586723712771136521058682371386113
    66710587623714961136821058912371716113694105891237237511369610589
    48573874659827645873645897326589763245897623489756389746538746538
    74652987346592873645987236459872634985763294857629387465923846593
    24589234503245234534850234578320467045608574976485976409567045607
    46507546094675049857640567840956784098576498759870937097098127980
    17981789237498275409834709210910983175483750983720072789023487957
    84570983745098746580976543789654379863457980657980564379865437980
    63409857643098567809654370986543789654379865347980654379863450987
    63049857609834576098347569083475609873450986734098576039845769084
    35760984576098347560987435908674530987603948576098435760983457609
    83475609834709687430986743098576943058760984357609834576098437560
    98435760984756983475609843756984357690856098760980910910982310948
    02938409321840928340921830941803980198409218430910930943218094321
    80943210984320983420984398065890896048906490842853280981098210943
    6654387653487645876348576348576348756384765387465837

    it probably took a super computer days to calculate the above and it in only 8630 digits!

    As far as i know, supercomputers have been calculation pi to the billion something digit, but they have been running for YEARS, even decades.

    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA

  30. #30
    appi101
    Guest
    Hi

    How will we do it anyway?

    Appi

  31. #31
    PowerPoster sail3005's Avatar
    Join Date
    Oct 2000
    Location
    Chicago, IL, USA
    Posts
    2,340
    do what? People have told you like 3 times to use that series!

    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA

  32. #32
    appi101
    Guest
    Hi

    I know that people have told me to use that series 3 times. But what I want to know is how to use it. If u could give me some code I'd appreciate it.

    Appi

  33. #33
    Dazed Member
    Join Date
    Oct 1999
    Location
    Ridgefield Park, NJ
    Posts
    3,418
    kedaman..... what is atn? Is that a function in VB? Im curious

    atn(1)*4 gives pi, and arcus tangens can be written as a series:

  34. #34
    appi101
    Guest

    `

    Atn is arctangent function.

    Since tan(pi/4) i.e. tan(45) is 1 atn(1) gives the value of pi/4. BUt this is just till some 6-9 places of decimal.

    Appi

  35. #35
    Frenzied Member mlewis's Avatar
    Join Date
    Sep 2000
    Posts
    1,226
    Use this code:

    X = 3
    Place:
    Y=1/X^2+Y
    X=X+2
    A=A+1
    lblPiValue = (8(1+Y))
    lblTries = A
    Goto Place

    Make sure its on a form with a two labels: lblPiValue and lblTries
    M. Lewis
    Pi-Q Software
    How many mouse clicks does it take to cook breakfast?

    Blargh! I am dead!

  36. #36
    Frenzied Member HarryW's Avatar
    Join Date
    Jan 2000
    Location
    Heiho no michi
    Posts
    1,827
    That code will never end though Might need to refresh the form or something so the values get updated.
    Harry.

    "From one thing, know ten thousand things."

  37. #37
    Frenzied Member mlewis's Avatar
    Join Date
    Sep 2000
    Posts
    1,226
    It will end -- use Ctrl+Pause or Ctrl+Alt+Del or if all else fails, pull the power cord.
    M. Lewis
    Pi-Q Software
    How many mouse clicks does it take to cook breakfast?

    Blargh! I am dead!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width