Funzione Sgn VBScript
Definizione e uso
La funzione Sgn può restituire un intero che indica il segno del numero specificato.
Sintassi
Sgn(number)
Parametro | Descrizione |
---|---|
number |
Obbligatorio. Espressione numerica valida. Se il numero è:
|
Esempio
Esempio 1
document.write(Sgn(15))
Output:
1
Esempio 2
document.write(Sgn(-5.67))
Output:
-1
Esempio 3
document.write(Sgn(0))
Output:
0