RE: [Python-Dev] Re: Decimal type question [Prothon]

"Mark Hahn" <[email protected]> Wed, 11 Aug 2004 11:36:42 -0700
Newsgroups gmane.comp.lang.prothon.user,gmane.comp.python.devel
Message-ID <000801c47fd2$26192ba0$0b01a8c0@mark>
Michael Chermside wrote:

>Mark Hahn writes:
>> I am more interested now in hearing about people's feelings on the=20
>> idea of having the Decimal type "in-between" Int and Float. =20
>Assume a=20
>> decent Decimal implementation is used.
>
>All right. I think that "in-between" Int and Float is a bad=20
>idea -- or at least that it's a bad way to think about a decent design.
>
>"in-between" suggests that Float has greater range than=20
>Decimal which has greater range than Int... but in your design=20
>that simply isn't true. Your Int, for instance, can represent=20
>values that neither Decimal nor Float can handle.

What do you think of the newer idea of using the IBM floating decimal =
for
all numerics?  Tim Peters and others pushed this on me. =20

Performance would be handled somewhat by automatically switching between
ints, bigints,  and decimal internally, but with no loss of precision =
except
when a divide or other such operation happens.  I would still have a
hardware based binary floating point type that you have to manually =
specify
if you want hardware performance for floats.

I am thinking of having all current constant formats default to the
"Decimal" type (0, 123, 123.456, 123e3) and have a new constant type =
using
the letter 'f' for the binary "Float" type (0f0, 123f0, 123.456f0, =
123.f3).