Re: Who told str() to round my int()'s!!!

2007-08-16 Thread A.T.Hofkamp
On 2007-08-15, Larry Bates [EMAIL PROTECTED] wrote: What are they teaching in schools these days? I see questions like this and the equally perplexing why don't floats represent numbers exactly? or the mildy amusing how do I write bytes not characters to a file questions at least once a

Re: Who told str() to round my int()'s!!!

2007-08-16 Thread baby's happy
I saw your article is very good, I like it very much. I will continue to pay attention to your article, the following are the points I hope that I have similar concerns. http://www.game-win.com http://www.game-win.com/wow-powerleveling.html http://www.game-win.com/faq.html

Re: Who told str() to round my int()'s!!!

2007-08-16 Thread John Nagle
A.T.Hofkamp wrote: On 2007-08-15, Larry Bates [EMAIL PROTECTED] wrote: or the mildy amusing how do I write bytes not characters to a file questions at least once a week on this forum. Actually, that's a reasonable question, and one that Python didn't do quite right. Remember, in the

Re: Who told str() to round my int()'s!!!

2007-08-16 Thread Neil Cerutti
On 2007-08-16, John Nagle [EMAIL PROTECTED] wrote: or the mildy amusing how do I write bytes not characters to a file questions at least once a week on this forum. Actually, that's a reasonable question, and one that Python didn't do quite right. Remember, in the beginning, Python had

Re: Who told str() to round my int()'s!!!

2007-08-16 Thread Diez B. Roggisch
John Nagle schrieb: A.T.Hofkamp wrote: On 2007-08-15, Larry Bates [EMAIL PROTECTED] wrote: or the mildy amusing how do I write bytes not characters to a file questions at least once a week on this forum. Actually, that's a reasonable question, and one that Python didn't do quite

Re: Who told str() to round my int()'s!!!

2007-08-16 Thread Chris Mellon
On 8/16/07, John Nagle [EMAIL PROTECTED] wrote: A.T.Hofkamp wrote: On 2007-08-15, Larry Bates [EMAIL PROTECTED] wrote: or the mildy amusing how do I write bytes not characters to a file questions at least once a week on this forum. Actually, that's a reasonable question, and one

Re: Who told str() to round my int()'s!!!

2007-08-15 Thread A.T.Hofkamp
On 2007-08-11, Adam W. [EMAIL PROTECTED] wrote: After a fair amount of troubleshooting of why my lists were coming back a handful of digits short, and the last digit rounded off, I determined the str() function was to blame: foonum 0.0071299720384678782 str(foonum) '0.00712997203847'

Re: Who told str() to round my int()'s!!!

2007-08-15 Thread Larry Bates
Steve Holden wrote: Roel Schroeven wrote: Adam W. schreef: After a fair amount of troubleshooting of why my lists were coming back a handful of digits short, and the last digit rounded off, I determined the str() function was to blame: foonum 0.0071299720384678782 str(foonum)

Re: Who told str() to round my int()'s!!!

2007-08-15 Thread Donn Cave
In article [EMAIL PROTECTED], A.T.Hofkamp [EMAIL PROTECTED] wrote: On 2007-08-11, Adam W. [EMAIL PROTECTED] wrote: After a fair amount of troubleshooting of why my lists were coming back a handful of digits short, and the last digit rounded off, I determined the str() function was to

Who told str() to round my int()'s!!!

2007-08-11 Thread Adam W.
After a fair amount of troubleshooting of why my lists were coming back a handful of digits short, and the last digit rounded off, I determined the str() function was to blame: foonum 0.0071299720384678782 str(foonum) '0.00712997203847' Why in the world does str() have any business rounding

Re: Who told str() to round my int()'s!!!

2007-08-11 Thread Marc 'BlackJack' Rintsch
On Sat, 11 Aug 2007 16:40:02 +, Adam W. wrote: After a fair amount of troubleshooting of why my lists were coming back a handful of digits short, and the last digit rounded off, I determined the str() function was to blame: foonum 0.0071299720384678782 str(foonum) '0.00712997203847'

Re: Who told str() to round my int()'s!!!

2007-08-11 Thread Adam W.
On Aug 11, 12:53 pm, Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote: If `str()` would not round you would get very long numbers because of the inaccuracies of floating point values. I know Python is lying when 0.1 prints as 0.1, but do you really want to see

Re: Who told str() to round my int()'s!!!

2007-08-11 Thread Roel Schroeven
Adam W. schreef: After a fair amount of troubleshooting of why my lists were coming back a handful of digits short, and the last digit rounded off, I determined the str() function was to blame: foonum 0.0071299720384678782 str(foonum) '0.00712997203847' Why in the world does str() have

Re: Who told str() to round my int()'s!!!

2007-08-11 Thread Marc 'BlackJack' Rintsch
On Sat, 11 Aug 2007 17:10:05 +, Adam W. wrote: On Aug 11, 12:53 pm, Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote: If `str()` would not round you would get very long numbers because of the inaccuracies of floating point values. I know Python is lying when 0.1 prints as 0.1, but do you

Re: Who told str() to round my int()'s!!!

2007-08-11 Thread Steve Holden
Roel Schroeven wrote: Adam W. schreef: After a fair amount of troubleshooting of why my lists were coming back a handful of digits short, and the last digit rounded off, I determined the str() function was to blame: foonum 0.0071299720384678782 str(foonum) '0.00712997203847' Why in the

Re: Who told str() to round my int()'s!!!

2007-08-11 Thread Zentrader
On Aug 11, 9:40 am, Adam W. [EMAIL PROTECTED] wrote: After a fair amount of troubleshooting of why my lists were coming back a handful of digits short, and the last digit rounded off, I determined the str() function was to blame: foonum 0.0071299720384678782 str(foonum)

Re: Who told str() to round my int()'s!!!

2007-08-11 Thread John Machin
On Aug 12, 5:37 am, Zentrader [EMAIL PROTECTED] wrote: On Aug 11, 9:40 am, Adam W. [EMAIL PROTECTED] wrote: After a fair amount of troubleshooting of why my lists were coming back a handful of digits short, and the last digit rounded off, I determined the str() function was to blame:

Re: Who told str() to round my int()'s!!!

2007-08-11 Thread Bjoern Schliessmann
Adam W. wrote: Why in the world does str() have any business rounding my numbers, You are at the floating point numbers precision limit. Using str, numbers are rounded to your machine's float precision in decimal notation. Since floats are internally represented in binary notation of constant