Skip to content

Update abs.adoc #377

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions Language/Functions/Math/abs.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,24 @@ subCategories: [ "Math" ]
--

[float]
=== Description
Calculates the absolute value of a number.
=== Descrizione
Calcola il valore assoluto di un numero.
[%hardbreaks]


[float]
=== Syntax
=== Sintassi
`abs(x)`

[float]
=== Parameters
`x`: the number
=== Parametri
`x`: il numero

[float]
=== Returns
`x`: if x is greater than or equal to 0.
=== Restituisce
`x`: se x se x è maggiore o uguale a 0.

`-x`: if x is less than 0.
`-x`: se x è minore di 0.

--
// OVERVIEW SECTION ENDS
Expand All @@ -47,14 +47,14 @@ Calculates the absolute value of a number.


[float]
=== Notes and Warnings
Because of the way the abs() function is implemented, avoid using other functions inside the brackets, it may lead to incorrect results.
=== Note e avvertenze
A causa del modo in cui è implementata la funzione abs(), si consiglia di evitare l'uso di altre funzioni all'interno delle parentesi, che potrebbe condurre a risultati errati.
[source,arduino]
----
abs(a++); // avoid this - yields incorrect results
abs(a++); // evitare questa funzione - produce risultati errati

abs(a); // use this instead -
a++; // keep other math outside the function
abs(a); // usare questa invece -
a++; // lasciate gli altri calcoli al di fuori della funzione
----
[%hardbreaks]

Expand Down