Perl is worse!
Grant Edwards
nobody at nowhere.nohow
Fri Jul 28 21:02:31 EDT 2000
In article <8ls9oe01f82 at news2.newsguy.com>, Alex Martelli wrote:
>"Grant Edwards" <ge at nowhere.none> wrote in message
>>>> Because numbers are numbers and strings are not. Given, Python's numeric
>>>> model is not very good.
>> >
>> >What is wrong with Python's numeric model ?
>>
>> I may be a minority, but I don't like integers being converted
>> to floats automatically.
>
>I have no problem with that _if it wastes NO information in so
>doing_. I believe that on typical machines of today (32-bit
>integers, 64-bit IEEE floating point) this can be guaranteed
>*for integers*. *LONG* integers are another matter...! And
>as I mentioned I think the rational solution to that problem is
>not to forbid numeric promotions but to ensure they never
>lead to information-loss by introducing the 'rational' type (a
>couple of long-integers taken as num/denom of a fraction).
>[That's why it's the *rational* solution:-)].
As long as the conversion can guarantee no information loss, I wouldn't have
a problem with it. I've yet to use a language that can make that guarantee.
I guess I never looked into the details in Python (haven't done much
numerical stuff yet). I had sort of assumed that floating point values were
32 bit, but if they're 64, then as you say, the problem is postponed until
long ints are involved.
--
Grant Edwards grante Yow! I wish I was on a
at Cincinnati street corner
visi.com holding a clean dog!
More information about the Python-list
mailing list