logaritmi con turbo pascal
turbologa.htm

gestione logaritmi con basi diverse
xturbologa34.htm xturbologa35.htm xturbologa36.htm


descrizione a livello didattico per calcoli su logaritmi usando funzioni fornite da
excel (pascal) oppure la tabella logaritmica dalla quale ottenere le mantisse e una
calcolatrice aritmetica per eseguire i calcoli e risalire con la tabella al numero cercato

turbologa34.htm turbologa35.htm turbologa36.htm

turbologa37.htm turbologa38.htm turbologa39.htm turbologa40.htm

turbologa41.htm turbologa42.htm turbologa43.htm turbologa44.htm

turbologa45.htm turbologa46.htm turbologa47.htm turbologa48.htm turbologa49.htm

 


definizione di logaritmo

esempio con base = 10 ,logaritmi interi

 

program logaritmo;
(* definizione di logaritmo *)
uses crt;
var a,b,c,d,e :integer;
    base :real;

function potenza(base:real;n:real):real;
begin
  if n=0 then potenza:=1
   else
   potenza:=base*potenza(base,n-1);
    end;

begin
writeln('k = logx(n) se x^k = n ');
writeln('si definisce k logaritmo in base x del numero n ');
writeln('se la base x elevata allo esponente k genera il numero n');
writeln('..............................................');
writeln('0           = log10(1)     : infatti 10^0 = 1');
writeln('1           = log10(10)    : infatti 10^1 = 10');
writeln('2           = log10(100)   : infatti 10^2 = 100');
writeln('3           = log10(1000)  : infatti 10^3 = 1000');
writeln('4           = log10(10000) : infatti 10^4 = 10000');
readln;
base:=10;

a:=0;
b:=1;
c:=2;
d:=3;
e:=4;
writeln('eseguo verifica usando la funzione potenza ');
writeln('log = 0 : ',potenza(base,a):6:2);
writeln('log = 1 : ',potenza(base,b):6:2) ;
writeln('log = 2 : ',potenza(base,c):6:2);
writeln('log = 3 : ',potenza(base,d):6:2);
writeln('log = 4 : ',potenza(base,e):6:2);
readln;
clrscr;
end.

esempio con base = 2 , logaritmi interi

 

program logaritmo;
(* definizione di logaritmo *)
uses crt;
var a,b,c,d,e :integer;
    base :real;

function potenza(base:real;n:real):real;
begin
  if n=0 then potenza:=1
   else
   potenza:=base*potenza(base,n-1);
    end;

begin
writeln('k = logx(n) se x^k = n ');
writeln('si definisce k logaritmo in base x del numero n ');
writeln('se la base x elevata allo esponente k genera il numero n');
writeln('..............................................');
writeln('2           = log2(4)     : infatti 2^2 = 4');
writeln('3           = log2(8)    : infatti 2^3 = 8');
writeln('4           = log2(16)   : infatti 2^4 = 16');
writeln('5           = log2(32)  : infatti 2^5 = 32');
writeln('6           = log2(64) : infatti 2^6 = 64');
readln;
base:=2;

a:=2;
b:=3;
c:=4;
d:=5;
e:=6;
writeln('eseguo verifica usando la funzione potenza ');
writeln('log = 2 : ',potenza(base,a):6:2);
writeln('log = 3 : ',potenza(base,b):6:2) ;
writeln('log = 4 : ',potenza(base,c):6:2);
writeln('log = 5 : ',potenza(base,d):6:2);
writeln('log = 6 : ',potenza(base,e):6:2);
readln;
clrscr;
end.

esempio con base = 4 logaritmi interi

 

program logaritmo;
(* definizione di logaritmo *)
uses crt;
var a,b,c,d,e :integer;
    base :real;

function potenza(base:real;n:real):real;
begin
  if n=0 then potenza:=1
   else
   potenza:=base*potenza(base,n-1);
    end;

begin
writeln('k = logx(n) se x^k = n ');
writeln('si definisce k logaritmo in base x del numero n ');
writeln('se la base x elevata allo esponente k genera il numero n');
writeln('..............................................');
writeln('2           = log4(16)     : infatti 4^2 = 16');
writeln('3           = log4(64)     : infatti 4^3 = 64');
writeln('4           = log4(256)    : infatti 4^4 = 256');
writeln('5           = log4(1024)   : infatti 4^5 = 1024');
writeln('6           = log4(4096)   : infatti 4^6 = 4096');
readln;
base:=4;

a:=2;
b:=3;
c:=4;
d:=5;
e:=6;
writeln('eseguo verifica usando la funzione potenza ');
writeln('log = 2 : ',potenza(base,a):6:2);
writeln('log = 3 : ',potenza(base,b):6:2) ;
writeln('log = 4 : ',potenza(base,c):6:2);
writeln('log = 5 : ',potenza(base,d):6:2);
writeln('log = 6 : ',potenza(base,e):6:2);
readln;
clrscr;
end.

logaritmi decimali xturbologa34.htm