<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <br>
    <br>
    <div class="moz-cite-prefix">Il 14/04/2015 10:23, Giuseppe Amato ha
      scritto:<br>
    </div>
    <blockquote
cite="mid:CAEmjXoPNx5M-MY+XDnWG0ECrDUPJc2zkxsa+ddCyUF7pjodJ8A@mail.gmail.com"
      type="cite">
      <div dir="ltr"><br>
        <div class="gmail_extra"><br>
          <div class="gmail_quote">Il giorno 14 aprile 2015 01:26,
            Carpediem <span dir="ltr"><<a moz-do-not-send="true"
                href="mailto:i.carpediem@tiscali.it" target="_blank">i.carpediem@tiscali.it</a>></span>
            ha scritto:<br>
            <blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">A
              questo punto, quindi, se chiedo di stampare s invece che
              ritrovarmi il valore 1 ottengo 0<br>
            </blockquote>
            <div><br>
            </div>
            <div>Beh il punto è che stai chiedendo una cosa e ne vuoi
              un'altra. </div>
            <div><br>
            </div>
            <div>
              <div><span style="font-size:12.8000001907349px">>>>
                  sb = 3287628061</span></div>
              <div><span style="font-size:12.8000001907349px">>>>
                  type(sb)</span></div>
              <div><span style="font-size:12.8000001907349px"><type
                  'long'></span></div>
              <div><span style="font-size:12.8000001907349px">>>>
                  mb = sb / 60</span></div>
              <div><span style="font-size:12.8000001907349px">>>>
                  type(mb)</span></div>
              <div><span style="font-size:12.8000001907349px"><type
                  'long'></span></div>
              <div><span style="font-size:12.8000001907349px">>>>
                  mb</span></div>
              <div><span style="font-size:12.8000001907349px">54793801L</span></div>
              <div><span style="font-size:12.8000001907349px">>>>
                  m1 = int(mb)</span></div>
              <div><span style="font-size:12.8000001907349px">>>>
                  type(m1)</span></div>
              <div><span style="font-size:12.8000001907349px"><type
                  'int'></span></div>
              <div>
                <div style=""><span style="font-size:12.8000001907349px">>>>
                    m1</span></div>
                <div style=""><span style="font-size:12.8000001907349px">54793801</span></div>
              </div>
              <div><span style="font-size:12.8000001907349px">>>>
                  s = int ((mb-m1)*60)</span></div>
              <div><span style="font-size:12.8000001907349px">>>>
                  type(s)</span></div>
              <div><span style="font-size:12.8000001907349px"><type
                  'int'></span></div>
              <div>
                <div style=""><span style="font-size:12.8000001907349px">>>>
                    s</span></div>
                <div style=""><span style="font-size:12.8000001907349px">0</span></div>
              </div>
              <div><br>
              </div>
            </div>
            <div><span style="font-size:12.8000001907349px">Nel codice
                che hai scritto i decimali non sono presi in
                considerazione, perché stai facendo operazioni su
                interi. </span></div>
            <div><span style="font-size:12.8000001907349px">Inoltre, la
                funzione int() non arrotonda ma converte, ciò vuol dire
                che 0.1 o 0.99 o 0.11111111111111112344 daranno lo
                stesso risultato: 0, che è la parte intera del numero.</span></div>
            <div><span style="font-size:12.8000001907349px">Non si
                tratta di un problema di virgola mobile, ma un problema
                di funzione, come già ti dicevano usa round().</span></div>
            <div><span style="font-size:12.8000001907349px"><br>
              </span></div>
            <div><span style="font-size:12.8000001907349px">Ciao</span></div>
          </div>
          <div><br>
          </div>
          Grazie a te e a tutti quelli che si sono adoperati a
          rispondermi. Ho usato round e ho risolto il problema. Grazie
          ancora a tutti<br>
          <div class="gmail_signature">____________________________<br>
            Giuseppe Amato<br>
            e-mail: <a moz-do-not-send="true"
              href="mailto:giuamato@gmail.com" target="_blank">giuamato@gmail.com</a></div>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Python mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Python@lists.python.it">Python@lists.python.it</a>
<a class="moz-txt-link-freetext" href="http://lists.python.it/mailman/listinfo/python">http://lists.python.it/mailman/listinfo/python</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>