How about adding rational fraction to Python?
D'Arcy J.M. Cain
darcy at druid.net
Thu Feb 28 11:22:43 EST 2008
On Thu, 28 Feb 2008 06:10:13 -0800 (PST)
Carl Banks <pavlovevidence at gmail.com> wrote:
> On Feb 28, 3:30 am, Dennis Lee Bieber <wlfr... at ix.netcom.com> wrote:
> > Automatic conversions, okay... but converting a result when all
> > inputs are of one time, NO...
>
> People, this is so cognitive dissonance it's not even funny.
I'll say.
> There is absolutely nothing obvious about 1/2 returning a number that
> isn't at least approximately equal to one half. There is nothing self-
> evident about operations maintaining types.
Not obvious to you. You are using subjective perception as if it was a
law of nature. If "obvious" was the criteria then I would argue that
the only proper result of integer division is (int, int). Give me the
result and the remainder and let me figure it out.
> You people can't tell the difference between "obvious" and "learned
> conventions that came about because in limitations in the hardware at
> the time". Nobody would have come up with a silly rule like "x op y
> must always have the same type as x and y" if computer hardware had
> been up to the task when these languages were created.
What makes you say they weren't? Calculating machines that handled
floating point are older than Python by far.
--
D'Arcy J.M. Cain <darcy at druid.net> | Democracy is three wolves
http://www.druid.net/darcy/ | and a sheep voting on
+1 416 425 1212 (DoD#0082) (eNTP) | what's for dinner.
More information about the Python-list
mailing list