Re: [Python-Dev] PEP 327: Decimal Data Type
From: Stephen Horne (steve_at_ninereeds.fsnet.co.uk)
Date: 01/30/04
- Next message: Michel Claveau/Hamster: "Re: python in dreamweaver"
- Previous message: Corey Coughlin: "Re: number of arguments a function takes"
- In reply to: Michael Chermside: "RE: [Python-Dev] PEP 327: Decimal Data Type"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 30 Jan 2004 22:32:17 +0000
On Fri, 30 Jan 2004 07:06:21 -0800, Michael Chermside
<mcherm@mcherm.com> wrote:
>Facundo Batista writes:
>> I'm proud to announce that the PEP for Decimal Data Type is now published
>> http://www.python.org/peps/pep-0327.html
>
>VERY nice work here.
>
>Here's my 2 cents:
>
> (1) You propose conversion from floats via:
> Decimal(1.1, 2) == Decimal('1.1')
> Decimal(1.1, 16) == Decimal('1.1000000000000001')
> Decimal(1.1) == Decimal('110000000000000008881784197001252...e-51')
>
> I think that we'd do even better to ommit the second use. People who
>really want to convert floats exactly can easily write "Decimal(1.1, 60)". But
>hardly anyone wants to convert floats exactly, while lots of newbies would
>forget to include the second parameter. I'd say just make Decimal(someFloat)
>raise a TypeError with a helpful message about how you need that second
>parameter when using floats.
Good point. A 'DecimalExact' or similar function could perhaps be
provided to replace the simple conversion when people have really
thought about it and do really want it.
-- Steve Horne steve at ninereeds dot fsnet dot co dot uk
- Next message: Michel Claveau/Hamster: "Re: python in dreamweaver"
- Previous message: Corey Coughlin: "Re: number of arguments a function takes"
- In reply to: Michael Chermside: "RE: [Python-Dev] PEP 327: Decimal Data Type"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|