diff --git a/Language/Functions/Math/max.adoc b/Language/Functions/Math/max.adoc index 56280fd..ec9666f 100644 --- a/Language/Functions/Math/max.adoc +++ b/Language/Functions/Math/max.adoc @@ -16,24 +16,24 @@ subCategories: [ "Math" ] -- [float] -=== Description -Calculates the maximum of two numbers. +=== Descrizione +Calcola il massimo di due numeri. [%hardbreaks] [float] -=== Syntax +=== Sintassi `max(x, y)` [float] -=== Parameters -`x`: the first number, any data type -`y`: the second number, any data type +=== Parametri +`x`: il primo numero, qualsiasi tipo di dati +`y`: il secondo numero, qualsiasi tipo di dati [float] -=== Returns -The larger of the two parameter values. +=== Restituisce +Il maggiore dei due valori. -- // OVERVIEW SECTION ENDS @@ -46,28 +46,28 @@ The larger of the two parameter values. -- [float] -=== Example Code +=== Codice di esempio // Describe what the example code is all about and add relevant code ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄ -The code ensures that sensVal is at least 20. +Il codice garantisce che sensVal sia pari almeno a 20. [source,arduino] ---- -sensVal = max(senVal, 20); // assigns sensVal to the larger of sensVal or 20 - // (effectively ensuring that it is at least 20) +sensVal = max(senVal, 20); // assegna a sensVal il valore maggiore tra sensVal e 20 + // (garantendo di fatto che sia almeno 20) ---- [%hardbreaks] [float] -=== Notes and Warnings -Perhaps counter-intuitively, `max()` is often used to constrain the lower end of a variable's range, while `min()` is used to constrain the upper end of the range. +=== Note e avvertenze +Per quanto possa essere controintuitivo, `max()` viene spesso utilizzato per limitare l'estremo inferiore dell'intervallo di una variabile, mentre `min()` viene utilizzato per limitare l'estremo superiore di un intervallo. -Because of the way the `max()` function is implemented, avoid using other functions inside the brackets, it may lead to incorrect results +Per via del modo in cui la funzione `max()` è implementata, è bene evitare l'uso di altre funzioni all'interno delle parentesi, che potrebbe condurre a risultati errati [source,arduino] ---- -max(a--, 0); // avoid this - yields incorrect results +max(a--, 0); // evita di farlo: produce risultati errati -max(a, 0); // use this instead - -a--; // keep other math outside the function +max(a, 0); // usa invece questo: +a--; // mantenendo gli altri calcoli al di fuori della funzione ---- --