Vai al contenuto

Funzioni matematiche

Consulta la libreria Math

Prova le funzioni matematiche di base

TextWindow.WriteLine("------------------------------------------------------")
TextWindow.WriteLine("---  Funzioni matematiche  ---------------------------")
TextWindow.WriteLine("------------------------------------------------------")
r=Math.Pi 
TextWindow.WriteLine("Pi                - Pi greco        = " + r)
TextWindow.WriteLine("------------------------------------------------------")
TextWindow.Write("Numero: ")
n=TextWindow.ReadNumber()
TextWindow.WriteLine("------------------------------------------------------")
r=Math.Abs(n)
TextWindow.WriteLine("Abs()             - Valore assoluto = " + r)
r=Math.GetRandomNumber(n)
TextWindow.WriteLine("GetRandomNumber() - Numero casuale  = " + r)
r=Math.SquareRoot(n)
TextWindow.WriteLine("SquareRoot()      - Radice quadrata = " + r)
TextWindow.WriteLine("------------------------------------------------------")
TextWindow.Write("Primo   numero: ")
n1=TextWindow.ReadNumber()
TextWindow.Write("Secondo numero: ")
n2=TextWindow.ReadNumber()
TextWindow.WriteLine("------------------------------------------------------")
r=Math.Max(n1,n2)
TextWindow.WriteLine("Max()             - Massimo         = " + r)
r=Math.Min(n1,n2)
TextWindow.WriteLine("Min()             - Minimo          = " + r)
r=Math.Power(n1,n2)
TextWindow.WriteLine("Power()           - Potenza         = " + r)
r=Math.Remainder(n1,n2)
TextWindow.WriteLine("Remainder()       - Resto           = " + r)
TextWindow.WriteLine("------------------------------------------------------")

Alcune funzioni potrebbero provocare degli errori critici in esecuzione.
Sarà necessario provarle separatamente…

Lascia un commento

Il tuo indirizzo email non sarà pubblicato. I campi obbligatori sono contrassegnati *

Questo sito usa Akismet per ridurre lo spam. Scopri come i tuoi dati vengono elaborati.