Sujet : Re: Division-bug in a beginner's script
De : ram (at) *nospam* zedat.fu-berlin.de (Stefan Ram)
Groupes : comp.lang.pythonDate : 14. Dec 2024, 10:08:57
Autres entêtes
Organisation : Stefan Ram
Message-ID : <bug-20241214100538@ram.dialup.fu-berlin.de>
Martin Ruppert <
ruppert@hs-worms.de> wrote or quoted:
z=.4
nen=7
You need:
z = ".4"
nen = "7"
. Here's an script:
import decimal
z=0.4
nen=7
decimal.getcontext().prec=60
print(decimal.Decimal(z)/decimal.Decimal(nen),end=' ');print(f"decimal: {z}/{nen}")
z='0.4'
nen='7'
decimal.getcontext().prec=60
print(decimal.Decimal(z)/decimal.Decimal(nen),end=' ');print(f"decimal: {z}/{nen}")
. Before you go off half-cocked and start throwing shade about
a Python library in your subject line, maybe you oughta hit
the books and get your ducks in a row first