Movatterモバイル変換


[0]ホーム

URL:


[Python-Dev] Re: PEP239 (Rational Numbers) Reference Implementation and new issues

Thomas Woutersthomas@xs4all.net
Tue, 8 Oct 2002 15:55:49 +0200


On Tue, Oct 08, 2002 at 08:41:31AM -0400, Paul Hughett wrote:> Greg Ewing wrote:> > So, I'm now reduced to suggesting>> >   <2/3>> How about 2r3, which could be pronounced "2 rational 3" and is syntactically> very similar to the universal 2e3?2e3 may be universal, I wouldn't say it's very universally used. Ipersonally never use the e-notation, and I can't say I find it veryreadable. Who do we expect to use rationals ? Is it something we wantnewbies to learn ? Will high/grade-school students with not compsci/mathbackground to recognize the e-notation be using rationals ? I'm not goingall happy-dayzy about rationals in the first place, but I know that isbecause I understand the implementation and tradeoffs of floating point, andthey are what I want :)I'd also say rational-literals are not that important. Looking at my ownPython code, I very rarely need a floating-point literal to start with.Strings, plenty, dicts and lists fairly often, integers every now and then,but floating point numbers very rarely, and almost all of them are just'0.0' or an integer expressed as float to force float-division. Most of myfloat objects come from (library) functions that return them.If we expect newbies to prefer rationals over fp, we need syntax that isclear to them (which may very well be just 'rat()'.) If we expect hard-coremathers like Tim and Moshe and Chris Tismer and even Guido to use them, I'dsay we don't need syntax support for them and can just live with rat().And I have to say some of the proposals for literal rationals I saw werevery disturbingly sick. Some of you need help, and some need to spend lesstime using XML :-)Beautiful-is-better-than-ug'ly y'rs,-- Thomas Wouters <thomas@xs4all.net>Hi! I'm a .signature virus! copy me into your .signature file to help me spread!


[8]ページ先頭

©2009-2025 Movatter.jp