/* [wxMaxima batch file version 1] [ DO NOT EDIT BY HAND! ]*/ /* [ Created with wxMaxima version 13.04.2 ] */ /* [wxMaxima: comment start ] Numero di Avogadro come frazione
Numero di Avogadro

Il numero di Avogadro diviso 10^24 vale, circa :
http://physics.nist.gov/cgi-bin/cuu/Value?na|search_for=avogadro
 : 0.6022140857 
   [wxMaxima: comment end   ] */

/* [wxMaxima: input   start ] */
navog:6022140857/10000000000$ float(navog);
/* [wxMaxima: input   end   ] */

/* [wxMaxima: input   start ] */
circa(nna,nlim):=block((j,k,prec:[0,1]),
for j:1 thru nlim step 1 do(
for k:1 thru nlim step 1 do ( 
   if (abs(nna-prec[1]/prec[2]) > abs(nna-k/j)) then (
   prec:[k,j] ))),
return (prec))$
/* [wxMaxima: input   end   ] */

/* [wxMaxima: input   start ] */
una:circa(navog,150)$
print("Numero approssimato di Avogadro: ",una," fraz: ",
float(una[1]/una[2])," Errore ",float(navog-una[1]/una[2]))$
/* [wxMaxima: input   end   ] */

/* [wxMaxima: input   start ] */
xna:circa(navog,600)$
print("Numero approssimato di Avogadro: ",xna," fraz: ",
float(xna[1]/xna[2])," Errore ",float(navog-xna[1]/xna[2]))$
/* [wxMaxima: input   end   ] */

/* [wxMaxima: input   start ] */
yna:circa(navog,1200)$
print("Numero approssimato di Avogadro: ",yna," fraz: ",
float(yna[1]/yna[2])," Errore ",float(navog-yna[1]/yna[2]))$
/* [wxMaxima: input   end   ] */

/* [wxMaxima: comment start ]
Dunque le buone approssimazioni sono: 53/88 
Meglio: 109/181 
Meglio: 707/1174
[wxMaxima: comment end ] */ /* Maxima can't load/batch files which end with a comment! */ "Created with wxMaxima"$