Movatterモバイル変換


[0]ホーム

URL:


[Python-Dev] Round Bug in Python 1.6?

Christian Tismertismer@tismer.com
Sun, 09 Apr 2000 20:53:51 +0200


Ka-Ping Yee wrote:>> On Sun, 9 Apr 2000, Christian Tismer wrote:> > Here is the problem, as I see it:> > You say if you type 3.1416, you want to get exactly this back.> > But how should Python know that you typed it in?> > Same in my case: I just rounded to 3 digits, but how> > should Python know about this?> >> > And what do you expect when you type in 3.14160, do you want> > the trailing zero preserved or not?>> It's okay for the zero to go away, because it doesn't affect> the value of the number.  (Carrying around a significant-digit> count or error range with numbers is another issue entirely,> and a very thorny one at that.)>> I think "fewest digits needed to distinguish the correct value"> will give good and least-surprising results here.  This method> guarantees:Hmm, I hope I understood.Oh, wait a minute! What is the method? What is the correct value?If I type>>> 0.10.10000000000000001>>> 0.100000000000000010.10000000000000001>>>There is only one value: The one which is in the machine.Would you think it is ok to get 0.1 back, when youactually *typed* 0.10000000000000001 ?-- Christian Tismer             :^)   <mailto:tismer@appliedbiometrics.com>Applied Biometrics GmbH      :     Have a break! Take a ride on Python'sKaunstr. 26                  :    *Starship*http://starship.python.net14163 Berlin                 :     PGP key ->http://wwwkeys.pgp.netPGP Fingerprint       E182 71C7 1A9D 66E9 9D15  D3CC D4D7 93E2 1FAE F6DF     where do you want to jump today?http://www.stackless.com


[8]ページ先頭

©2009-2025 Movatter.jp