pro15

PASCAL VISUAL EXCEL sintassi per variabili numeriche
pascall
operazioni
addizione + a+b interi-reali
sottrazione - a-b interi-reali
moltiplicazione * a*b interi-reali
divisione DIV a DIV b interi
resto MOD a MOD b interi
divisione / a/b reali

funzioni particolari(interi e reali)
assoluto abs(x)
quadrato sqr(x)
radice quadrata sqrt(x)
esponenziale exp(x)
arrotondamento round(x)
troncamento trunc(x)
intero int(x)

ASSEGNAZIONE valore x:=valore

OPERATORI vari AND,OR,NOT,>,<,<>...

DICHIARAZIONE con Var nome:tipo;

assoluto abs(x)
intero int(x)
troncato trunc(x)
arrotondato round(x)
quadrato sqr(x)
radice quadrata sqrt(x)
casuale random(1)
quoziente x div y
resto x mod y
esponenziale exp(x)
logaritmo n. ln(x)
logaritmo d. ln(x)/ln(10)
seno sin(x)
coseno cos(x)

program pro5;
uses crt;
var x,y:integer;
    r:real;
begin
clrscr;
writeln(abs(-5));
writeln(int(5.23));
writeln(trunc(5.26));
writeln(round(7.8));
writeln(sqr(5));
writeln(sqrt(100));
writeln(random(1));
writeln(100 div 20);
writeln(100 mod 12);
writeln(exp(3));
writeln(ln(100));
writeln(ln(100)/ln(10));
writeln(sin(30*PI/180));
writeln(cos(30*PI/180));
readln;
ritorna

VISUAL BASIC e VBA

ASSEGNAZIONE valore x=dato

OPERATORI vari AND,OR,NOT,>,<,<>...

DICHIARAZIONE con DIM nome e tipo
dim x as integer
dim a,b,c as integer
dim a as integer,b as integer
dim a as integer,x as string
assoluto abs(x)
segno sgn(x)
intero int(x)
quadrato sqr(x)
casuale rnd()
esponenziale exp(x)
logaritmo n. log(x)
logaritmo d. log(x)/log(10)
potenza x^n
seno sin(x)
coseno cos(x)
tangente tan(x)
arcotangente atn(x)

Private Sub CommandButton1_Click()
Cells(1, 1) = Abs(-5)
Cells(2, 1) = Sgn(-5)
Cells(3, 1) = Int(-5)
Cells(4, 1) = Rnd()
Cells(5, 1) = Sqr(4)
Cells(7, 1) = Exp(2)
Cells(8, 1) = Log(100)
Cells(9, 1) = Log(100) / Log(10)
Cells(10, 1) = Sin(30 * 3.14 / 180)
Cells(11, 1) = Cos(30 * 3.14 / 180)
Cells(12, 1) = Tan(30 * 3.14 / 180)
Cells(13, 1) = Atn(2)
Cells(14, 1) = 10 ^ 3
Cells(15, 1) = 10 Mod 3

End Sub
Private Sub CommandButton1_Click()
Dim g As Double
g = 30 * 3.14 / 180
Cells(1, 1) = Abs(5)
Cells(2, 1) = Sgn(5)
Cells(3, 1) = Int(5.42)
Cells(4, 1) = Sqr(5)
Cells(5, 1) = Rnd(5)
Cells(6, 1) = Exp(2)
Cells(7, 1) = Log(100)
Cells(8, 1) = Log(100) / Log(10)
Cells(9, 1) = 5 ^ 3
Cells(10, 1) = Sin(g)
Cells(11, 1) = Cos(g)
Cells(12, 1) = Tan(g)
Cells(13, 1) = Atn(2)
End Sub
Private Sub CommandButton1_Click()
Cells(1, 1) = Abs(-5)
Cells(2, 1) = Sgn(-5)
Cells(3, 1) = Int(-5)
Cells(4, 1) = Rnd()
Cells(5, 1) = Sqr(4)
Cells(7, 1) = Exp(2)
Cells(8, 1) = Log(100)
Cells(9, 1) = Log(100) / Log(10)
Cells(10, 1) = Sin(30 * 3.14 / 180)
Cells(11, 1) = Cos(30 * 3.14 / 180)
Cells(12, 1) = Tan(30 * 3.14 / 180)
Cells(13, 1) = Atn(2)
Cells(14, 1) = 10 ^ 3
Cells(15, 1) = 10 Mod 3

End Sub
ritorna

EXCEL
=ASS(-5)
=SEGNO(5)
=INT(5,43)
=TRONCA(123,56)
=ARROTONDA(123,456;2)
=POTENZA(10;2)
=RADQ(100)
=CASUALE()
=RESTO(10;4)
=EXP(3)
=FATTORIALE(5)
=LN(100)
=LOG(100;2)
=LOG10(100)
=PARI(123,34)
=PI.GRECO()
=PRODOTTO(3;4;5)
=SEN(1)
=COS(1)
=DISPARI(123,45)
=SOMMA(2;3;4)
=TAN(1)
=ARCCOS(1)
=ARCSEN(1)
=ARCTAN(1)
=MAX(20;3)
=MIN(30;3)
ritorna	

inizio