Author Topic: First post!  (Read 1355 times)

badkarma

  • VIP
  • Member
  • ***
  • Posts: 497
  • Kudos: 0
First post!
« on: 20 July 2002, 04:59 »
yay  :D
If you can't learn to do something well, learn to enjoy doing it poorly.

choasmaster

  • Member
  • **
  • Posts: 199
  • Kudos: 0
First post!
« Reply #1 on: 20 July 2002, 05:06 »
what the hell is this, slashdot???
id rather be on fire then use windoze

x86, a hack on a hack of a hack
alpha, the compaqed way
ppc, the fruity way
mips, the graphical way
m68k, the NeXT way
sparc, the reliable way


badkarma

  • VIP
  • Member
  • ***
  • Posts: 497
  • Kudos: 0
First post!
« Reply #2 on: 20 July 2002, 06:33 »
no ... but I was bored .. and couldn't think of anything usefull to say ....

anyways ... any c++/ Qt programming questions can be fired at my direction  :D
If you can't learn to do something well, learn to enjoy doing it poorly.

voidmain

  • VIP
  • Member
  • ***
  • Posts: 5,605
  • Kudos: 184
    • http://voidmain.is-a-geek.net/
First post!
« Reply #3 on: 20 July 2002, 07:42 »
Ok, how do I calculate pi to 10,000 decimal places in C++?
Someone please remove this account. Thanks...

choasmaster

  • Member
  • **
  • Posts: 199
  • Kudos: 0
First post!
« Reply #4 on: 20 July 2002, 13:19 »
your defiantly gonna need to use long long. im guessing that c++ would be terible langauge to do that in, im guessing that fortran would be a better idea
id rather be on fire then use windoze

x86, a hack on a hack of a hack
alpha, the compaqed way
ppc, the fruity way
mips, the graphical way
m68k, the NeXT way
sparc, the reliable way


voidmain

  • VIP
  • Member
  • ***
  • Posts: 5,605
  • Kudos: 184
    • http://voidmain.is-a-geek.net/
First post!
« Reply #5 on: 20 July 2002, 19:35 »
Actually it's really easy to do in C (or any language for that matter) and it doesn't take a long to do it.  You can figure it in an appropriately structured loop and output each digit as you figure it.  The program doesn't actually keep the entire resulting number in memory. In fact you can go farther than 10,000 decimal places, will just take some time.
Someone please remove this account. Thanks...

voidmain

  • VIP
  • Member
  • ***
  • Posts: 5,605
  • Kudos: 184
    • http://voidmain.is-a-geek.net/
First post!
« Reply #6 on: 21 July 2002, 08:48 »
Well, here is an example in C:

http://mathforum.org/library/drmath/view/54343.html

On my Laptop with a PII 350Mhz it took just under 20 seconds to calculate pi to 10,000 decimal places without any code optimizations.  On my Athalon 1600 it took just over 5 seconds to get 10,000 places with no optimizations.

If I compile the source with the "-O3" flag I see a *drastic* improvement.  1.8 seconds on the Athalon and 7.5 seconds on the PII.

You can time it by using the "time" command:

time ./a.out 10000

Also it should be noted that this program is only accurate up to a certain number of digits (not sure how many but I think it is under 1000 digits).  Anyone have a really accurate method to calculate any number of digits?  There must be a way since they have calculated many millions of digits.

[ July 21, 2002: Message edited by: VoidMain ]

Someone please remove this account. Thanks...

jtpenrod

  • VIP
  • Member
  • ***
  • Posts: 675
  • Kudos: 105
First post!
« Reply #7 on: 21 July 2002, 11:37 »
quote:
Ok, how do I calculate pi to 10,000 decimal places in C++?
See This Site for a C program to get the job done. There is also a Fortran program there as well. The only caviate is that the results can be determined in hex only. The algorithm doesn't work for decimal numbers.
_________________________________________

Live Free or Die: Linux

If software can be free, why can't dolphins?

[ July 21, 2002: Message edited by: jtpenrod ]

[ July 21, 2002: Message edited by: jtpenrod ]

Live Free or Die: Linux
If software can be free, why can't dolphins?

choasmaster

  • Member
  • **
  • Posts: 199
  • Kudos: 0
First post!
« Reply #8 on: 21 July 2002, 13:22 »
to caclutlate pi to millions of decimals places, well, the solarise admin down the street could probably tell me howto make a space shuttle, a railgun, give me 5 or 6 REAL movies of monica and clinton, letalone a program to calculate pi to a few billion decimal places, then agian, if did any of these, id probably be a test subject at area51


/*btw, if youve not figured out that he works at nsa and this is a joke, shame on you*/
id rather be on fire then use windoze

x86, a hack on a hack of a hack
alpha, the compaqed way
ppc, the fruity way
mips, the graphical way
m68k, the NeXT way
sparc, the reliable way