D
Sorry about that. <http://www.kenjikojima.com/>
Nice collection of unix tools, Cygwin not needed.Dick said:Paul Rubin wrote at 18:20 4/13/2005:
I don't believe GNU "bc" is available for Windows, is it?
Thanks,
Dick Moores
(e-mail address removed)
Dick said:M.E.Farmer wrote at 23:18 4/14/2005:
Wow! this got me the 3003 (changed from 3000) digits of pi to base 12 in
60.8 secs. No, I didn't count them yet, nor am I sure they're correct.
But I'd bet on them..
Could someone remind me how to get the output of bc -l into a text file
on Windows? (I've tried employing " > pi3003.txt" in various ways) OR,
how to copy and paste from the command line window, or whatever that
window is called? (Sorry for the OT question.)
Works for me (using the Cygwin version though) when I do
C:\cygwin\bin\bc -l > pi12.txt
Otherwise, to copy from the command prompt window: open the system menu
(icon in the top left corner of the window) and choose Edit->Mark. Then
select what you want to copy and press Enter or choose Edit->Copy in the
system menu.
To copy from the command window to the clipboard:M.E.Farmer wrote at 23:18 4/14/2005:
Wow! this got me the 3003 (changed from 3000) digits of pi to base 12 in
60.8 secs. No, I didn't count them yet, nor am I sure they're correct.
But I'd bet on them..
Could someone remind me how to get the output of bc -l into a text file
on Windows? (I've tried employing " > pi3003.txt" in various ways) OR,
how to copy and paste from the command line window, or whatever that
window is called? (Sorry for the OT question.)
Dick Moores said:But how or when do you enter the lines
scale = 3000
obase = 12
print 4 * a(1)
To copy from the command window to the clipboard:
1. Scroll top of desired stuff to make it visible near top
2. Hold down Alt
3. Tap Space Bar
4. Release Alt
5. Tap e
6. Tap k
7. Use mouse or arrow keys to place cursor on top left corner of desired box
8. Hold down Shift
9. Use arrow keys or mouse-with-left-button-pressed to go to bottom
right character of desired box
9a. If the bottom is out of sight, keep holding shift down and pretend
you can cursor down below bottom.
the attempt should make the screen scroll up and select more
desired material. If you overshoot, don't panic,
just keep holding down shift and use arrows (the are slower) or
mouse-with-left-button-still-down to move to
desired bottom right corner.
10. Release mouse button if using that
11. Release Shift
12. Press Enter
That should copy to the clipboard and make the selection box revert to
normal display.
Pasting from clipboard is up to you. Pasting into the command window
from clipboard
is 2-5 above, and Tap p
PS. Redirecting with > from a script whose interpreter was started by
windows extension association
doesn't work on some version of windows. To be safe, invoke the
interpreter explicitly, e.g.,
python myscript.py [whatever args here] > pi3003.txt
You could put them into a file, say pi.bc. Then run
bc -l pi.bc
windows extension association
doesn't work on some version of windows. To be safe, invoke the
interpreter explicitly, e.g.,
python myscript.py [whatever args here] > pi3003.txt
Any that your script allows or understands.Thanks very much for this.
What kind of args could I use here?
Nick said:[snip]I'm using GMPY (see code).
If you are using gmpy you might as well do it like this.....
gmpy.pi() uses the Brent-Salamin Arithmetic-Geometric Mean formula
for
pi IIRC. This converges quadratically, and it will calculate you a
million places without breaking a sweat.
It would be nice if that were documented. What do I have to do, go get
the documentation for the original GMP to find out what else is in GMPY
that they didn't include in the doc file?
Nick said:Nick said:I'm using GMPY (see code).
[snip]
If you are using gmpy you might as well do it like this.....
gmpy.pi() uses the Brent-Salamin Arithmetic-Geometric Mean formula
for
pi IIRC. This converges quadratically, and it will calculate you a
million places without breaking a sweat.
It would be nice if that were documented. What do I have to do, go get
the documentation for the original GMP to find out what else is in GMPY
that they didn't include in the doc file?
"pydoc gmpy" works for me. Not sure how you use pydoc on windows, but
you can do this...
Help on module gmpy:
NAME
gmpy
FILE
/usr/lib/python2.3/site-packages/gmpy.so
[snip]
Help on built-in function pi:
pi(...)
pi(n): returns pi with n bits of precision in an mpf object
[snip]
The original gmp documentation is sensible also, since gmpy is really
just a thin wrapper to it.
There is also the gmp source code too.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.