Re: how to generate pi in c
On Mon, 13 Dec 2010 15:28:59 -0800 Rick Stevens wrote: > Marko Vojinovic wrote: > > Second, there are certain theoretical > ideas about the distribution > > of digits in transcendental numbers which can make progress via > > such lengthy computations. > > > > Nobody needs more than about 6 figures for doing any engineering > > work, however. IIRC the most accurate measurement of any quantity in nature is that of the fine structure constant with 12 significant digits, so one really doesn't usually need much precision. > Is string theory, quantum mechanics or relativity the "truer" > reflection of reality? Hell, we sent space probes on close fly-bys > of Uranus and hit asteroids using good ol' Newtonian mechanics. Good luck in getting GPS to work without relativity. Or your computer without quantum mechanics; you need it to get a reasonable description of semiconductors (e.g. transistors) or lasers (your cdrom drive). But this discussion is really OT to this list. -- Jussi Lehtola Fedora Project Contributor jussileht...@fedoraproject.org -- users mailing list users@lists.fedoraproject.org To unsubscribe or change subscription options: https://admin.fedoraproject.org/mailman/listinfo/users Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Re: how to generate pi in c
On 12/13/2010 02:36 PM, Mike McCarty wrote: > Marko Vojinovic wrote: >> On Sat, Nov 6, 2010 at 8:43 AM, Mogens Kjaer wrote: http://www.kurims.kyoto-u.ac.jp/~ooura/pi_fft.html You'll need RAM to get many digits. >>> 1.6 G decimals in 20 hours on a machine with 16G RAM, running >>> x86_64 Fedora 12. >> >> Really, I'm curious, is there any real-world problem where anyone >> would actually *need* pi to a G decimal places? I mean, are these kind >> of computations actually useful for someone, or is it just a matter of >> "we have the power to do it, so let's do it" thing? Other than entry >> into the Guinness book of records, that is? > > Yes, there is. Belated response, I know. > > There are two important uses for such computations I can > think of off the top of my head. > > First, it's a good test of the functionality of a new machine. > When the first new unit runs off the factory floor, this type > of lengthy computation with known results is a good test. (Flash back 15 years) "I am Pentium of Borg. Division is futile. You will be approximated." > Second, there are certain theoretical ideas about the distribution > of digits in transcendental numbers which can make progress via > such lengthy computations. > > Nobody needs more than about 6 figures for doing any engineering > work, however. Is string theory, quantum mechanics or relativity the "truer" reflection of reality? Hell, we sent space probes on close fly-bys of Uranus and hit asteroids using good ol' Newtonian mechanics. (Just twisting the tail!) -- - Rick Stevens, Systems Engineer, C2 Hosting ri...@nerd.com - - AIM/Skype: therps2ICQ: 22643734Yahoo: origrps2 - -- - Make it idiot proof and someone will make a better idiot. - -- -- users mailing list users@lists.fedoraproject.org To unsubscribe or change subscription options: https://admin.fedoraproject.org/mailman/listinfo/users Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Re: how to generate pi in c
Marko Vojinovic wrote: > On Sat, Nov 6, 2010 at 8:43 AM, Mogens Kjaer wrote: >>> http://www.kurims.kyoto-u.ac.jp/~ooura/pi_fft.html >>> >>> You'll need RAM to get many digits. >> 1.6 G decimals in 20 hours on a machine with 16G RAM, running >> x86_64 Fedora 12. > > Really, I'm curious, is there any real-world problem where anyone > would actually *need* pi to a G decimal places? I mean, are these kind > of computations actually useful for someone, or is it just a matter of > "we have the power to do it, so let's do it" thing? Other than entry > into the Guinness book of records, that is? Yes, there is. Belated response, I know. There are two important uses for such computations I can think of off the top of my head. First, it's a good test of the functionality of a new machine. When the first new unit runs off the factory floor, this type of lengthy computation with known results is a good test. Second, there are certain theoretical ideas about the distribution of digits in transcendental numbers which can make progress via such lengthy computations. Nobody needs more than about 6 figures for doing any engineering work, however. Mike -- p="p=%c%s%c;main(){printf(p,34,p,34);}";main(){printf(p,34,p,34);} Oppose globalization and One World Governments like the UN. This message made from 100% recycled bits. You have found the bank of Larn. I speak only for myself, and I am unanimous in that! -- users mailing list users@lists.fedoraproject.org To unsubscribe or change subscription options: https://admin.fedoraproject.org/mailman/listinfo/users Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Re: how to generate pi in c
Arthur Bela wrote: > Does anyone has a "generate-pi.c" source code? Someone recently came up with an algorithm which would calculate arbitrary bits of the value of PI, as in binary digits. So you could calculate the trillionth place 0 or 1 without all the intervening bits. Should you find a use for it, the article was in several digests, so I assume you can look it up. I didn't. -- Bill Davidsen "We have more to fear from the bungling of the incompetent than from the machinations of the wicked." - from Slashdot -- users mailing list users@lists.fedoraproject.org To unsubscribe or change subscription options: https://admin.fedoraproject.org/mailman/listinfo/users Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Re: how to generate pi in c
--- On Mon, 11/8/10, Marko Vojinovic wrote: > From: Marko Vojinovic > Subject: Re: how to generate pi in c > To: "Community support for Fedora users" > Date: Monday, November 8, 2010, 3:27 PM > On Monday, November 08, 2010 18:00:55 > Bruno Wolff III wrote: > > > On Monday, November 08, 2010 04:49:33 Tim wrote: > > > > On Sat, 2010-11-06 at 17:13 +0100, > Klaus-Peter Schrage wrote: > > > > > You are probably alle wrong - pi equals > 3.125, see: > > > > > http://www.correctpi.com/ > > > > > > > > I was always under the impression that pi > was merely the ratio of the > > > > circumference to the diameter, something > that's easy enough to prove > > > > empirically (measure the two, and do the > maths). > > > > Just remember that depends on Euclidean Geometry. In > other geometries (say > > very large circles on the surface of the earth) the > ratio is different. > > Ok, well, since this thread is already so far off-topic for > a Fedora list, it > won't hurt much to add a few more lines... :-) > > The pi can actually be defined as a period of the > exponential function, exp(z), > in the imaginary direction. This is quite fundamental, and > doesn't depend on > any geometry definition whatsoever. Everything else can be > considered a > consequence, if you set up your axioms in a convenient > way... ;-) e^{i\pi} + 1 = 0 \pi = (\ln(-1)/i), but \ln(-1) does not exist? in the Real Numbers, and i = \sqrt(-1). Interesting, indeed :) > > Best, :-) > Marko > > -- Regards, Antonio -- users mailing list users@lists.fedoraproject.org To unsubscribe or change subscription options: https://admin.fedoraproject.org/mailman/listinfo/users Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Re: how to generate pi in c
--- On Mon, 11/8/10, Joe Zeff wrote: > From: Joe Zeff > Subject: Re: how to generate pi in c > To: "Community support for Fedora users" > Date: Monday, November 8, 2010, 10:38 AM > On 11/08/2010 10:00 AM, Bruno Wolff > III wrote: > > Just remember that depends on Euclidean Geometry. In > other geometries (say > > very large circles on the surface of the earth) the > ratio is different. > > And, of course, let's not forget the time that B.S. Johnson > managed to > make pi equal exactly three in a small volume of space. > -- And There is the mention of pi in the bible: http://www.biblegateway.com/passage/?search=1+Kings+7%3A23&version=KJV http://www.abarim-publications.com/Bible_Commentary/Pi_In_The_Bible.html There are always the infinite series involving 4*arctan(1.0) and the famous approximations 22/7 and 355/113, the subject is rich and beautiful. Wonder what we can do in pi day (March 14, 2011)? It will be on a Monday :) [oliva...@ghs-e213-3 Documents]$ cal 3 2011 March 2011 Su Mo Tu We Th Fr Sa 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 [oliva...@ghs-e213-3 Documents]$ uname -r 2.6.34.7-61.fc13.x86_64 Regards, Antonio -- users mailing list users@lists.fedoraproject.org To unsubscribe or change subscription options: https://admin.fedoraproject.org/mailman/listinfo/users Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Re: how to generate pi in c
Am 08.11.2010 20:54, schrieb Tim: > Klaus-Peter Schrage: http://www.correctpi.com/ > > Tim: >>> I was always under the impression that pi was merely the ratio of the >>> circumference to the diameter, something that's easy enough to prove >>> empirically (measure the two, and do the maths). > > Marko Vojinovic: >> Hey Tim, didn't you read a hidden ROTFLMAO between the lines above? :-D > > Well, somewhere along the line I suspect there's a bit of "that guy was > nuts" in the reasoning for referring to him. But you're never quite > sure, when someone refers to something like that, if they were taking > him seriously. > Now, I was the one referring to that site - I admit, with some irony in mind. Without any irony this time: I took my math degree 35 years ago, so my basics might be somewhat rusty, but they are fresh enough to know that such a treatise is not worth to be read on after the first page. Klaus -- users mailing list users@lists.fedoraproject.org To unsubscribe or change subscription options: https://admin.fedoraproject.org/mailman/listinfo/users Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Re: how to generate pi in c
The following program will compute pi to three (3) places (approximately :-) #define _ -F<00 || --F-OO--; int F=00,OO=00; main(){F_OO();printf("%1.3f\n", 4.*-F/OO/OO);}F_OO() { _-_-_-_ _-_-_-_-_-_-_-_-_ _-_-_-_-_-_-_-_-_-_-_-_ _-_-_-_-_-_-_-_-_-_-_-_-_-_ _-_-_-_-_-_-_-_-_-_-_-_-_-_-_ _-_-_-_-_-_-_-_-_-_-_-_-_-_-_ _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ _-_-_-_-_-_-_-_-_-_-_-_-_-_-_ _-_-_-_-_-_-_-_-_-_-_-_-_-_-_ _-_-_-_-_-_-_-_-_-_-_-_-_-_ _-_-_-_-_-_-_-_-_-_-_-_ _-_-_-_-_-_-_-_-_ _-_-_-_ } Be sure to compile like this: gcc -traditional-cpp pi_calc.c -o pi_calc.x Then run like this: ./pi_calc.x W/o the "-traditional-cpp" switch you will, instead, get an excellent approximation to 1/4. Excercise: Discover how the program works? Once you do, you will know how to make it more accurate, so that you can compute pi to _any_ finite precision you like. :-) This code was the winner of one of the wonderful "Obfuscated C" contests in the early 1990's or late 1980's. Dean -- users mailing list users@lists.fedoraproject.org To unsubscribe or change subscription options: https://admin.fedoraproject.org/mailman/listinfo/users Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Re: how to generate pi in c
On Mon, 8 Nov 2010, Bruno Wolff III wrote: > Just remember that depends on Euclidean Geometry. In other geometries (say > very large circles on the surface of the earth) the ratio is different. There aren't terribly many useful non-Euclidean geometries for which there is a "the ratio". Spherical geometry is not one of them. -- Michael henne...@web.cs.ndsu.nodak.edu "Pessimist: The glass is half empty. Optimist: The glass is half full. Engineer: The glass is twice as big as it needs to be." -- users mailing list users@lists.fedoraproject.org To unsubscribe or change subscription options: https://admin.fedoraproject.org/mailman/listinfo/users Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Re: how to generate pi in c
Klaus-Peter Schrage: >>> http://www.correctpi.com/ Tim: >> I was always under the impression that pi was merely the ratio of the >> circumference to the diameter, something that's easy enough to prove >> empirically (measure the two, and do the maths). Marko Vojinovic: > Hey Tim, didn't you read a hidden ROTFLMAO between the lines above? :-D Well, somewhere along the line I suspect there's a bit of "that guy was nuts" in the reasoning for referring to him. But you're never quite sure, when someone refers to something like that, if they were taking him seriously. You didn't notice a "you've got to be kidding?" hidden in my first paragraph? ;-) I read a fair bit of what was on that site, but my eyes glazed over rather rapidly. It was like proving a banana by discussing elephants. -- [...@localhost ~]$ uname -r 2.6.27.25-78.2.56.fc9.i686 Don't send private replies to my address, the mailbox is ignored. I read messages from the public lists. -- users mailing list users@lists.fedoraproject.org To unsubscribe or change subscription options: https://admin.fedoraproject.org/mailman/listinfo/users Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Re: how to generate pi in c
and... drum roll pi are squared... cake are round!!! gotta love those numonics! On Mon, Nov 8, 2010 at 10:38 AM, Joe Zeff wrote: > On 11/08/2010 10:00 AM, Bruno Wolff III wrote: >> Just remember that depends on Euclidean Geometry. In other geometries (say >> very large circles on the surface of the earth) the ratio is different. > > And, of course, let's not forget the time that B.S. Johnson managed to > make pi equal exactly three in a small volume of space. > -- > users mailing list > users@lists.fedoraproject.org > To unsubscribe or change subscription options: > https://admin.fedoraproject.org/mailman/listinfo/users > Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines > -- users mailing list users@lists.fedoraproject.org To unsubscribe or change subscription options: https://admin.fedoraproject.org/mailman/listinfo/users Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Re: how to generate pi in c
On 11/08/2010 10:00 AM, Bruno Wolff III wrote: > Just remember that depends on Euclidean Geometry. In other geometries (say > very large circles on the surface of the earth) the ratio is different. And, of course, let's not forget the time that B.S. Johnson managed to make pi equal exactly three in a small volume of space. -- users mailing list users@lists.fedoraproject.org To unsubscribe or change subscription options: https://admin.fedoraproject.org/mailman/listinfo/users Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Re: how to generate pi in c
On Mon, Nov 08, 2010 at 12:07:47 +, Marko Vojinovic wrote: > On Monday, November 08, 2010 04:49:33 Tim wrote: > > On Sat, 2010-11-06 at 17:13 +0100, Klaus-Peter Schrage wrote: > > > You are probably alle wrong - pi equals 3.125, see: > > > http://www.correctpi.com/ > > > > I was always under the impression that pi was merely the ratio of the > > circumference to the diameter, something that's easy enough to prove > > empirically (measure the two, and do the maths). > [snip a serious response] > > Hey Tim, didn't you read a hidden ROTFLMAO between the lines above? :-D Just remember that depends on Euclidean Geometry. In other geometries (say very large circles on the surface of the earth) the ratio is different. -- users mailing list users@lists.fedoraproject.org To unsubscribe or change subscription options: https://admin.fedoraproject.org/mailman/listinfo/users Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Re: how to generate pi in c
I haven't really followed the thread but here's a link that might be handy: http://gmplib.org/pi-with-gmp.html -- Thanks! Regards, Ankur https://fedoraproject.org/wiki/User:Ankursinha "FranciscoD" -- users mailing list users@lists.fedoraproject.org To unsubscribe or change subscription options: https://admin.fedoraproject.org/mailman/listinfo/users Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Re: how to generate pi in c
On Sat, 2010-11-06 at 17:13 +0100, Klaus-Peter Schrage wrote: > You are probably alle wrong - pi equals 3.125, see: > http://www.correctpi.com/ I was always under the impression that pi was merely the ratio of the circumference to the diameter, something that's easy enough to prove empirically (measure the two, and do the maths). What you do with pi after that, such as calculating areas or volumes, is entirely another matter. Whatever you think about what the numerical of pi should be, it's interesting how pi is used in all sorts of things that you wouldn't necessarily relate to circles (such as electronics formulae), and the accepted 3.14... value works properly. Of course, if you believed it shouldn't be 3.14, you could argue that pi shouldn't have been used, but pi *and* a corrective factor, that happened to equal 3.14. But that would seem just a bit too much of trying to hard to justify a false belief. -- [...@localhost ~]$ uname -r 2.6.27.25-78.2.56.fc9.i686 Don't send private replies to my address, the mailbox is ignored. I read messages from the public lists. -- users mailing list users@lists.fedoraproject.org To unsubscribe or change subscription options: https://admin.fedoraproject.org/mailman/listinfo/users Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Re: how to generate pi in c
On 11/07/2010 01:26 PM, Marko Vojinovic wrote: > I found it really hard to believe that such "results" are still possible to > get published by anyone. I'll bet that if you looked carefully, the book was "self published," which just means that he's gotten the book printed at his own expense, probably by a vanity press. -- users mailing list users@lists.fedoraproject.org To unsubscribe or change subscription options: https://admin.fedoraproject.org/mailman/listinfo/users Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Re: how to generate pi in c
On 11/07/2010 12:08 PM, Wolfgang S. Rupprecht wrote: > > Klaus-Peter Schrage writes: >> You are probably alle wrong - pi equals 3.125, see: >> http://www.correctpi.com/ > > Arrrg. I don't believe that I actually tried to read that and follow > his logic. Now my brain hurts. This needs a NSFB warning. > One question: does he ever explain why his value gets the wrong answers and the "traditional" one doesn't? Back on the original topic, I suppose, if you want to be weird, you could try the method I did, about 25 years ago: use numeric integration to find the area under the function f(x) = sqrt( 1 - y^2 ) from 0 to 1 then multiply by 4. I did it in FORTRAN on a CP/M machine and it needed all night to come up with an answer to the limits of the machine's precision. -- users mailing list users@lists.fedoraproject.org To unsubscribe or change subscription options: https://admin.fedoraproject.org/mailman/listinfo/users Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Re: how to generate pi in c
Klaus-Peter Schrage writes: > You are probably alle wrong - pi equals 3.125, see: > http://www.correctpi.com/ Arrrg. I don't believe that I actually tried to read that and follow his logic. Now my brain hurts. This needs a NSFB warning. -wolfgang -- Wolfgang S. Rupprecht http://www.wsrcc.com/wolfgang/ (IPv6-only) -- users mailing list users@lists.fedoraproject.org To unsubscribe or change subscription options: https://admin.fedoraproject.org/mailman/listinfo/users Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Re: how to generate pi in c
On Sat, 2010-11-06 at 12:18 +, Marko Vojinovic wrote: > Really, I'm curious, is there any real-world problem where anyone > would actually *need* pi to a G decimal places? Making math is the best and pure form to develop creativity, art. Theory(science) can be learned by reading. Technique by repeating the activity. :) -- Rodolfo Alcazar Portillo - nosp...@gmail.com otbits.blogspot.com / counter.li.org: #367962 -- There are two rules for success in life: Rule 1: Don't tell people everything you know. -- users mailing list users@lists.fedoraproject.org To unsubscribe or change subscription options: https://admin.fedoraproject.org/mailman/listinfo/users Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Re: how to generate pi in c
On Sat, 2010-11-06 at 12:18 +, Marko Vojinovic wrote: > On Sat, Nov 6, 2010 at 8:43 AM, Mogens Kjaer wrote: > >> http://www.kurims.kyoto-u.ac.jp/~ooura/pi_fft.html > >> > >> You'll need RAM to get many digits. > > > > 1.6 G decimals in 20 hours on a machine with 16G RAM, running > > x86_64 Fedora 12. > > Really, I'm curious, is there any real-world problem where anyone > would actually *need* pi to a G decimal places? I mean, are these kind > of computations actually useful for someone, or is it just a matter of > "we have the power to do it, so let's do it" thing? Other than entry > into the Guinness book of records, that is? > > Or maybe there are still people who believe pi is rational rather than > transcendent, and look for a cyclic repeat pattern in the decimals? > ;-) > > :-) > Marko PI is used for some kinds of random number generators and in some kinds of encryption applications. It is psuedo random because it is derived from a static calculation, but it is random enough over large numbers of bits for some specialized uses. Also haveing it out to large numbers of places is useful for some kinds of repetitive calculations in computational analysis, since each multiplication loses essentially 1/2 bit. If you have enough bits to start with, then the loss won't show up in the final calculation. Some kinds of simulations require enormous calculation chains, which in turn means loss of accuracy. It is not that the accuracy of 1G bits (or bytes) of PI can be directly applied in the real world (getting A/D's that work well down to 32 bits is a challenge.) but the loss of precision in some types of research, in some real world chained calculations, and in some matrix math does become an issue. Regards, Les H -- users mailing list users@lists.fedoraproject.org To unsubscribe or change subscription options: https://admin.fedoraproject.org/mailman/listinfo/users Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Re: how to generate pi in c
Am 06.11.2010 13:18, schrieb Marko Vojinovic: > On Sat, Nov 6, 2010 at 8:43 AM, Mogens Kjaer wrote: >>> http://www.kurims.kyoto-u.ac.jp/~ooura/pi_fft.html >>> >>> You'll need RAM to get many digits. >> >> 1.6 G decimals in 20 hours on a machine with 16G RAM, running >> x86_64 Fedora 12. > > Really, I'm curious, is there any real-world problem where anyone > would actually *need* pi to a G decimal places? I mean, are these kind > of computations actually useful for someone, or is it just a matter of > "we have the power to do it, so let's do it" thing? Other than entry > into the Guinness book of records, that is? > > Or maybe there are still people who believe pi is rational rather than > transcendent, and look for a cyclic repeat pattern in the decimals? You are probably alle wrong - pi equals 3.125, see: http://www.correctpi.com/ Klaus -- users mailing list users@lists.fedoraproject.org To unsubscribe or change subscription options: https://admin.fedoraproject.org/mailman/listinfo/users Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Re: how to generate pi in c
On Sat, Nov 06, 2010 at 12:18:45PM +, Marko Vojinovic wrote: > On Sat, Nov 6, 2010 at 8:43 AM, Mogens Kjaer wrote: > >> http://www.kurims.kyoto-u.ac.jp/~ooura/pi_fft.html > >> > >> You'll need RAM to get many digits. > > > > 1.6 G decimals in 20 hours on a machine with 16G RAM, running > > x86_64 Fedora 12. > > Really, I'm curious, is there any real-world problem where anyone > would actually *need* pi to a G decimal places? I mean, are these kind > of computations actually useful for someone, or is it just a matter of > "we have the power to do it, so let's do it" thing? Other than entry > into the Guinness book of records, that is? > > Or maybe there are still people who believe pi is rational rather than > transcendent, and look for a cyclic repeat pattern in the decimals? > ;-) Or maybe they've read Carl Sagan's novel "Contact" and are hoping he was right... -- Fred Smith -- fre...@fcshome.stoneham.ma.us - The Lord detests the way of the wicked but he loves those who pursue righteousness. - Proverbs 15:9 (niv) - -- users mailing list users@lists.fedoraproject.org To unsubscribe or change subscription options: https://admin.fedoraproject.org/mailman/listinfo/users Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Re: how to generate pi in c
On 11/06/2010 01:18 PM, Marko Vojinovic wrote: > On Sat, Nov 6, 2010 at 8:43 AM, Mogens Kjaer wrote: >>> http://www.kurims.kyoto-u.ac.jp/~ooura/pi_fft.html >>> >>> You'll need RAM to get many digits. >> >> 1.6 G decimals in 20 hours on a machine with 16G RAM, running >> x86_64 Fedora 12. > > Really, I'm curious, is there any real-world problem where anyone > would actually *need* pi to a G decimal places? Is there a *need* to climb Mount Everest ? Actually, I had a machine with a RAM failure a couple of years ago. It took days for Memtest86+ to find this error. The FFT code above (the same was used in s...@home) made the error show up within a few hours. ... > > Or maybe there are still people who believe pi is rational rather than > transcendent, and look for a cyclic repeat pattern in the decimals? > ;-) Read Carl Sagan: Contact. :-) Mogens -- Mogens Kjaer, m...@lemo.dk http://www.lemo.dk -- users mailing list users@lists.fedoraproject.org To unsubscribe or change subscription options: https://admin.fedoraproject.org/mailman/listinfo/users Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Re: how to generate pi in c
On Sat, Nov 6, 2010 at 8:43 AM, Mogens Kjaer wrote: >> http://www.kurims.kyoto-u.ac.jp/~ooura/pi_fft.html >> >> You'll need RAM to get many digits. > > 1.6 G decimals in 20 hours on a machine with 16G RAM, running > x86_64 Fedora 12. Really, I'm curious, is there any real-world problem where anyone would actually *need* pi to a G decimal places? I mean, are these kind of computations actually useful for someone, or is it just a matter of "we have the power to do it, so let's do it" thing? Other than entry into the Guinness book of records, that is? Or maybe there are still people who believe pi is rational rather than transcendent, and look for a cyclic repeat pattern in the decimals? ;-) :-) Marko -- users mailing list users@lists.fedoraproject.org To unsubscribe or change subscription options: https://admin.fedoraproject.org/mailman/listinfo/users Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Re: how to generate pi in c
On 11/06/2010 09:01 AM, Mogens Kjaer wrote: ... > http://www.kurims.kyoto-u.ac.jp/~ooura/pi_fft.html > > You'll need RAM to get many digits. 1.6 G decimals in 20 hours on a machine with 16G RAM, running x86_64 Fedora 12. No way near a record, but I don't have access to a machine with more RAM Mogens -- Mogens Kjaer, m...@lemo.dk http://www.lemo.dk -- users mailing list users@lists.fedoraproject.org To unsubscribe or change subscription options: https://admin.fedoraproject.org/mailman/listinfo/users Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Re: how to generate pi in c
On 11/05/2010 05:40 PM, Arthur Bela wrote: > Does anyone has a "generate-pi.c" source code? http://www.kurims.kyoto-u.ac.jp/~ooura/pi_fft.html You'll need RAM to get many digits. Mogens -- Mogens Kjaer, m...@lemo.dk http://www.lemo.dk -- users mailing list users@lists.fedoraproject.org To unsubscribe or change subscription options: https://admin.fedoraproject.org/mailman/listinfo/users Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Re: how to generate pi in c
On Fri, 2010-11-05 at 19:12 +0100, Rodolfo Alcazar Portillo wrote: > On Fri, 2010-11-05 at 17:40 +0100, Arthur Bela wrote: > > Does anyone has a "generate-pi.c" source code? > > And do not lose Fabrice Bellard's Pi record... with Fedora. > http://bellard.org/ Damn! Didn't knew he was beaten by a guy who used a Windows server! :( -- Rodolfo Alcazar Portillo - nosp...@gmail.com otbits.blogspot.com / counter.li.org: #367962 -- "Ich bin immer noch Atheist, Gott sei Dank!" - Luis Buñuel -- users mailing list users@lists.fedoraproject.org To unsubscribe or change subscription options: https://admin.fedoraproject.org/mailman/listinfo/users Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Re: how to generate pi in c
On Fri, 2010-11-05 at 17:40 +0100, Arthur Bela wrote: > Does anyone has a "generate-pi.c" source code? And do not lose Fabrice Bellard's Pi record... with Fedora. http://bellard.org/ Cheers. -- Rodolfo Alcazar Portillo - nosp...@gmail.com otbits.blogspot.com / counter.li.org: #367962 -- "Wenn sich Intel und Microsoft in deine Sache einmischen, weißt du, dass du etwas richtig machst." - Nicholas Negroponte, auf der Fachkonferenz LinuxWorld 2006 in Boston verteidigte sich Negroponte mit diesen Worten gegen Kritik von Microsoft und Intel an seinem 100 Dollar Laptop -- users mailing list users@lists.fedoraproject.org To unsubscribe or change subscription options: https://admin.fedoraproject.org/mailman/listinfo/users Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Re: how to generate pi in c
On 11/05/2010 09:49 AM, Andrew Haley wrote: > On 11/05/2010 04:40 PM, Arthur Bela wrote: >> Does anyone has a "generate-pi.c" source code? > > Lots of people do. You'll have to be a bit more specific about > what you actually want. I guess it's more than > > 4*atan(1.0) > > Andrew. As a side note, Dan Alderson (He wrote JPL's spaceprobe navigation software back in the late '70s, early '80s.) always used that in his programs because it got pi to machine accuracy, not just the number of digits you wrote. -- users mailing list users@lists.fedoraproject.org To unsubscribe or change subscription options: https://admin.fedoraproject.org/mailman/listinfo/users Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Re: how to generate pi in c
On Fri, 5 Nov 2010 17:40:34 +0100 Arthur Bela wrote: > Does anyone has a "generate-pi.c" source code? bsd-games has a pi tool for some reason -- users mailing list users@lists.fedoraproject.org To unsubscribe or change subscription options: https://admin.fedoraproject.org/mailman/listinfo/users Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Re: how to generate pi in c
On Fri, Nov 5, 2010 at 9:40 AM, Arthur Bela wrote: > Does anyone has a "generate-pi.c" source code? a[52514],b,c=52514,d,e,f=1e4,g,h;main(){for(;b=c-=14;h=printf("%04d", e+d/f))for(e=d%=f;g=--b*2;d/=g)d=d*b+f*(h?a[b]:f/5),a[b]=d%--g;} ...though that's only good for the first 15,000 digits. You probably need to be more specific about what you're looking for; the literature on generating digits of pi is pretty extensive. Cf. http://www.comlab.ox.ac.uk/jeremy.gibbons/publications/spigot.pdf -- users mailing list users@lists.fedoraproject.org To unsubscribe or change subscription options: https://admin.fedoraproject.org/mailman/listinfo/users Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Re: how to generate pi in c
On 11/05/2010 09:40 AM, Arthur Bela wrote: > Does anyone has a "generate-pi.c" source code? > > Thanks.. :D :\ I do not have that specific file, but this might help you Calculate pi to 800 digits in 160 characters of code. Written by Dik T. Winter at CWI. int a=1,b,c=2800,d,e,f[2801],g;main(){for(;b-c;)f[b++]=a/5; for(;d=0,g=c*2;c-=14,printf("%.4d",e+d/a),e=d%a)for(b=c;d+=f[b]*a, f[b]=d%--g,d/=g--,--b;d*=b);} See http://www.di-mgt.com.au/cprog.html -- users mailing list users@lists.fedoraproject.org To unsubscribe or change subscription options: https://admin.fedoraproject.org/mailman/listinfo/users Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Re: how to generate pi in c
On 11/05/2010 04:40 PM, Arthur Bela wrote: > Does anyone has a "generate-pi.c" source code? > > Thanks.. :D :\ Any book on numerical algorithms should give you a good run down on how you can implement this in general. If you're not looking to get too deep into this then Wikipedia has an article that discusses historical and current methods for evaluating Pi to a certain degree of accuracy: http://en.wikipedia.org/wiki/Pi If you just need the value then the standard C maths library supplies pre-defined mathematical constants that you can use in your programs: http://www.gnu.org/s/libc/manual/html_node/Mathematical-Constants.html http://www.gnu.org/s/libc/manual/html_node/Trig-Functions.html If none of these satisfies your needs then you'll need to explain what you want to do with the pi generator in a bit more detail. Regards, Bryn. -- users mailing list users@lists.fedoraproject.org To unsubscribe or change subscription options: https://admin.fedoraproject.org/mailman/listinfo/users Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Re: how to generate pi in c
On 11/05/2010 04:40 PM, Arthur Bela wrote: > Does anyone has a "generate-pi.c" source code? Lots of people do. You'll have to be a bit more specific about what you actually want. I guess it's more than 4*atan(1.0) Andrew. -- users mailing list users@lists.fedoraproject.org To unsubscribe or change subscription options: https://admin.fedoraproject.org/mailman/listinfo/users Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
how to generate pi in c
Does anyone has a "generate-pi.c" source code? Thanks.. :D :\ -- users mailing list users@lists.fedoraproject.org To unsubscribe or change subscription options: https://admin.fedoraproject.org/mailman/listinfo/users Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines