My list alters given values on read ?



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 14/03/2011 at 07:23, xxxxxxxx wrote:

    Whats happening here ?

    [15.588470458984375, 15.588470458984375, 4.5]
    Korrekt => 2.188
    first value wrong -> (2.1880000000000002, 3.1819999999999999, 2.0, 2.9630000000000001, 2.0, 3.125, 2.0, 3.25, 2.125, 3.3999999999999999, 2.0, 3.2000000000000002, 1.8999999999999999, 3.1669999999999998, 1.8460000000000001, 3.0, 1.875, 3.0, 1.895, 3.0, 2.125)
    3.464

    all the ones with more than 3 digits after the smicolum are wrong or am I?

        nutrate_m4 = round(7.0/3.2, 3)                     # M4 standard Nut DIN 934   
        nutrate_m4flat = round(7.0/2.2, 3)                # M4 standard Nut DIN 934 flat   
        nutrate_m5 = round(8.0/4.0, 3)                     # M5 standard Nut DIN 934   
        nutrate_m5flat = round(8.0/2.7, 3)                # M5 standard Nut DIN 934 flat   
        nutrate_m6 = round(10.0/5.0, 3)                # M6 standard Nut DIN 934   
        nutrate_m6flat = round(10.0/3.2, 3)           # M6 standard Nut DIN 934 flat   
        nutrate_m8 = round(13.0/6.5, 3)                # M8 standard Nut DIN 934   
        nutrate_m8flat = round(13.0/4.0, 3)           # M8 standard Nut DIN 934 flat   
        nutrate_m10 = round(17.0/8.0, 3)                # M10 standard Nut DIN 934   
        nutrate_m10flat = round(17.0/5.0, 3)           # M10 standard Nut DIN 934 flat   
        nutrate_m10_new = round(16.0/8.0, 3)           # M10 standard Nut DIN ??? NEW   
        nutrate_m10flat_new = round(16.0/5.0, 3)      # M10 standard Nut DIN ??? flat NEW   
        nutrate_m12 = round(19.0/10.0, 3)                # M12 standard Nut DIN 934   
        nutrate_m12flat = round(19.0/6.0, 3)           # M12 standard Nut DIN 934 flat   
        nutrate_m16 = round(24.0/13.0, 3)                # M16 standard Nut DIN 934   
        nutrate_m16flat = round(24.0/8.0, 3)           # M16 standard Nut DIN 934 flat   
        nutrate_m20 = round(30.0/16.0, 3)                # M20 standard Nut DIN 934   
        nutrate_m20flat = round(30.0/10.0, 3)           # M20 standard Nut DIN 934 flat   
        nutrate_m24 = round(36.0/19.0, 3)                # M24 standard Nut DIN 934   
        nutrate_m24flat = round(36.0/12.0, 3)           # M24 standard Nut DIN 934 flat   
        nutrate_x1 = round(8.5/4.0, 3)                    # sondermaß ?   
      
        nutlist = (nutrate_m4, nutrate_m4flat, nutrate_m5, nutrate_m5flat, nutrate_m6, nutrate_m6flat, nutrate_m8, nutrate_m8flat, nutrate_m10, nutrate_m10flat, nutrate_m10_new, nutrate_m10flat_new, nutrate_m12, nutrate_m12flat, nutrate_m16, nutrate_m16flat, nutrate_m20, nutrate_m20flat, nutrate_m24, nutrate_m24flat, nutrate_x1)   
        print nutrate_m4, nutlist   
        ratio = round(alist[1]/alist[2], 3)   
        print ratio
    


  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 14/03/2011 at 08:24, xxxxxxxx wrote:

    This should just happen on output. Internally the value should return True
    on print nutrate_m4==2.188.


Log in to reply