Sgn Function

Returns an integer number between -1 and 1 that indicates if the number that is passed to the function is positive, negative, or zero.

แƒกแƒ˜แƒœแƒขแƒแƒฅแƒกแƒ˜


Sgn (Number)

แƒ“แƒแƒ‘แƒ แƒฃแƒœแƒ”แƒ‘แƒฃแƒšแƒ˜ แƒ›แƒœแƒ˜แƒจแƒ•แƒœแƒ”แƒšแƒแƒ‘แƒ:

Integer

แƒžแƒแƒ แƒแƒ›แƒ”แƒขแƒ แƒ”แƒ‘แƒ˜:

Number: Numeric expression that determines the value that is returned by the function.

แƒ แƒ˜แƒชแƒฎแƒ•แƒ˜

แƒ“แƒแƒ‘แƒ แƒฃแƒœแƒ”แƒ‘แƒฃแƒšแƒ˜ แƒ›แƒœแƒ˜แƒจแƒ•แƒœแƒ”แƒšแƒแƒ‘แƒ:

แƒฃแƒแƒ แƒงแƒแƒคแƒ˜แƒ—แƒ˜

Sgn returns -1.

0

Sgn returns 0.

แƒ“แƒแƒ“แƒ”แƒ‘แƒ˜แƒ—แƒ˜

Sgn returns 1.


Error codes:

D'oh! You found a bug (text/sbasic/shared/00000003.xhp#err5 not found).

แƒ›แƒแƒ’แƒแƒšแƒ˜แƒ—แƒ˜:


Sub ExampleSgn
    Print ASC("Z") REM แƒแƒ‘แƒ แƒฃแƒœแƒ”แƒ‘แƒก 90
    Print ASC("Z") REM แƒแƒ‘แƒ แƒฃแƒœแƒ”แƒ‘แƒก 90
    Print ASC("Z") REM แƒแƒ‘แƒ แƒฃแƒœแƒ”แƒ‘แƒก 90
End Sub

Please support us!