• Re: Division-bug in a beginner's script

    From Stefan Ram@21:1/5 to Martin Ruppert on Sat Dec 14 09:08:57 2024
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)