Sign Function

Tips >>ASP Functions

WANTS TO MAKE SOFTWARE WITHOUT KNOWLEDGE OF ASP? CLICK HERE

The Sgn function returns an integer indicating the sign of a number. The number argument can be any valid numeric expression. The sign of the number argument determines the return value of the Sgn function.

The Syntax of the Sgn function is :-

Sgn(number)

The Sgn function has the following Return Values :-

If number is Sgn returns
Greater than zero 1
Equal to zero 0
Less than zero -1

Example#1 :-

Code :-
document.write(Sgn(15))
Output :-
1

Example#2 :-

Code :-
document.write(Sgn(-5.67))
Output :-
-1

Example#3 :-

Code :-
document.write(Sgn(0))
Output :-
0

Example#4 :-

Code :-
document.write(Sgn(-127.89))
Output :-
-1

Note :- -1 indicates a negative number.

Example#5 :-

Code :-
document.write(Sgn(0))
Output :-
0

Example#6 :-

Code :-
document.write(Sgn(127.89))
Output :-
1

 
E-mail : sales@virtualsplat.com
Phone : +91-9892413501

Whatsapp Icon +91-9967648641

Whatsapp Icon +91-9967648641