[Python-ideas] Python Numbers as Human Concept Decimal System
Oscar Benjamin
oscar.j.benjamin at gmail.com
Thu Mar 6 17:41:34 CET 2014
On 6 March 2014 15:49, Stefan Krah <stefan at bytereef.org> wrote:
> Oscar Benjamin <oscar.j.benjamin at ...> writes:
>> On 6 March 2014 12:36, Stefan Krah <stefan at ...> wrote:
>> > Regarding decimal literals:
>> >
>> > Possible in 3.x, but it would require some investigation if
>> > people really want arbitrary precision arithmetic by default
>> > rather than e.g. IEEE Decimal64.
>>
>> Interesting. I wasn't aware of Decimal64.
>>
>> I don't understand your question/point though. The Decimal module
>> doesn't provide "arbitrary" precision arithmetic by default. It
>> provides 28 digit precision arithmetic by default. It does however
>> allow the creation of Decimal instances with effectively arbitrary
>> precision from strings, integers etc.
>
> Well, yes. You can also emulate Decimal64 with the appropriate
> context parameters.
>
> I meant "arbitrary precision facilities by setting context parameters",
> but probably many people want to keep those.
>
> Due to the compact representation (bid64 or bid128), Decimal64 or
> Decimal128 would be interesting for doing arithmetic on huge matrices.
I'm still not totally clear here.
Do you mean that decimals created with a decimal literal e.g. 1.123d
would be some other kind of decimal object that always used a special
arithmetic context so that they behaved like a fixed width Decimal64
type? And then someone who wants to do decimal arithmetic with other
contexts would still need to import decimal and do the context stuff
themselves?
Oscar
More information about the Python-ideas
mailing list