pro15
VISUAL sintassi per variabili numeriche
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