Abs Function

Vraca apsolutnu vrijednost brojcanog izraza.

Sintaksa:


Abs (Broj)

Vrati vrijednost:

Double

Parametri:

Broj: Brojcani izraz za koji zelite apsolutnu vrijednost. Pozitivni brojevi, ukljucujuci 0, vracaju se neizmjenjeni, negativni brojevi se pretvaraju u pozitivne brojeve.

The following example uses the Abs function to calculate the difference between two values. It does not matter which value you enter first.

Error codes:

5 Invalid procedure call

Primjer:


Sub ExampleDifference
Dim siW1 As Single
Dim siW2 As Single
    siW1 = Int(InputBox("Please enter the first amount","Value Input"))
    siW2 = Int(InputBox("Please enter the second amount","Value Input"))
    Print "The difference is "; Abs(siW1 - siW2)
End Sub

Please support us!