Re: [Tutor] Two Scripts, Same Commands, One Works, One Doesn't

2019-05-15 Thread John Collins
am a student not a tutor - this is wild speculation! Best Regards, John Collins. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] greater precision?

2012-10-29 Thread John Collins
Hi Mark, Thanks. I wouldn't know C if I fell over it. Until recently, the *only* language I'd ever used was (HP, GW)BASIC aside from Fortran 101, 3 decades ago! John. On 30/10/2012 2:45 AM, Mark Lawrence wrote: If you're more comfortable with C you can use printf style formatting see http://doc

Re: [Tutor] greater precision?

2012-10-29 Thread John Collins
Thanks Mark. I 'stuck' with 2.7.2 for these old scripts, unless I want to totally rewrite them. They are so elegant, this would realy amount to starting from scratch. I get 15 reported, and that's going to be sufficient for these 'as they are'. For more, it's a go back to year zero exercise I feel

Re: [Tutor] greater precision?

2012-10-29 Thread John Collins
Hello, Just checked my py, and 15 was the report! Wish I had known that factoid - thank you, for a very complete coverage of the broader intrinsic 'machine' + system precision - it actually makes sense to me now - it's a calculation! On 30/10/2012 2:02 AM, eryksun wrote: A double has 53 bits o

Re: [Tutor] greater precision?

2012-10-29 Thread John Collins
Hi Dave, Valid question. However, there are no hidden variables used in format. Each time you invoke the format method (it's a method of str), it starts from scratch using only its current arguments. i can't think of any sense in which 'default' fits here, either. Thanks, that's somewhat of a

Re: [Tutor] greater precision?

2012-10-29 Thread John Collins
Hi Dave, Not silly at all. I didn't realize str(float) would truncate to 12 digits either. I found out by experimenting (with 2.7) in the interpreter. Very gracious of you to say, and generous of you to trouble yourself to experiment - thank you very much! Note that it may differ from version

Re: [Tutor] greater precision?

2012-10-29 Thread John Collins
Hi Dave, You just lost me. If you don't use any transcendental functions, then a fraction has no quantization error. It's totally precise. Ah ha! Another light bulb moment - two in one night! Thank you Dave, and all! John. ___ Tutor maillist - T

Re: [Tutor] greater precision?

2012-10-29 Thread John Collins
Hi Dave, Not true. That's just what it was truncated to upon output. If you want to show 15 digits, then use formatted output instead of str() inside the realprint() function. BIG light bulb moment! I had no idea the str() statement was truncating! I *did* search the script for "12" or "trunc"

Re: [Tutor] greater precision?

2012-10-29 Thread John Collins
Hi Dave, Thanks, more insights! I was only concerned that there was some correction in one of the messages. And since there was only 3 minutes between them, i didn't know which might be the corrected one. They showed up here out of order. I responded to the one with the later timestamp. No, m

Re: [Tutor] greater precision?

2012-10-29 Thread John Collins
Hi Peter, Thanks. [On modern hardware] Python uses IEEE 754 double-precision internally which gives 15 to 17 digits. But of course errors may accumulate. As in my previous, this script seems to output precisely 12 significant not 15 and not 17. ???

Re: [Tutor] greater precision?

2012-10-29 Thread John Collins
Hi Steve, Thanks. From >>>mkpoints.py 32 32.txt here's a sample of the output -0.396087591388 -0.781284022758 0.482400140683 -0.967387012461 -0.0838047084421 -0.239037944614 0.0208969821213 -0.489420208746 0.871797668848 0.887250003871 -0.258893773768 -0.38178717178 0.426352071227 -0.45775840872

Re: [Tutor] greater precision?

2012-10-29 Thread John Collins
Hi Dave Did you really leave two very-similar messages 3 minutes apart? Or are you using a broken gateway, like Google-groups, and it hiccoughed? Sorry, I didn't intend to - flunky LH mouse microswitch! Without knowing the type of the arguments being passed to the crosspoint() function, we ca

[Tutor] greater precision?

2012-10-29 Thread John Collins
her, but if I can squeeze out *at least* 15 sig figs, (30 or more would be better!) I'd be a happy camper! XNumbers addon for Excel allows over 200 sig figs by switching to base 256 IIRC. It is this with which I'd like to examine the output of these pyto scripts at finer re

[Tutor] greater precision?

2012-10-29 Thread John Collins
her, but if I can squeeze out *at least* 15 sig figs, (30 or more would be better!) I'd be a happy camper! XNumbers addon for Excel allows over 200 sig figs by switching to base 256 IIRC. It is this with which I'd like to examine the output of these pyto scripts at finer re

[Tutor] print to file probelm

2011-08-15 Thread John Collins
Hi, I'm a baffled beginner. The script below is one of a suite of scripts written by Simon Tatham a decade ago; http://www.chiark.greenend.org.uk/~sgtatham/polyhedra/ http://www.chiark.greenend.org.uk/~sgtatham/polyhedra/polyhedra.tar.gz OS: WinXP Py Ver: 2.7 Script: canvas.py It reads fro