Difference between revisions of "Documentation/How Tos/Calc: SIGN function"

From Apache OpenOffice Wiki
Jump to: navigation, search
(Initial content)
 
m
Line 3: Line 3:
 
== SIGN ==
 
== SIGN ==
 
Returns the sign of a number:-  1 if the number is positive, -1 if negative and 0 if zero.
 
Returns the sign of a number:-  1 if the number is positive, -1 if negative and 0 if zero.
 
  
 
=== Syntax: ===
 
=== Syntax: ===
 
<tt>'''SIGN(number)'''</tt>
 
<tt>'''SIGN(number)'''</tt>
 
: <tt>'''number'''</tt> is the number whose sign is to be determined.
 
: <tt>'''number'''</tt> is the number whose sign is to be determined.
 
  
 
=== Example: ===
 
=== Example: ===
Line 19: Line 17:
 
<tt>'''SIGN(0)'''</tt>
 
<tt>'''SIGN(0)'''</tt>
 
: returns <tt>'''0'''</tt>.
 
: returns <tt>'''0'''</tt>.
 
  
 
=== See also: ===
 
=== See also: ===

Revision as of 07:02, 2 March 2008


SIGN

Returns the sign of a number:- 1 if the number is positive, -1 if negative and 0 if zero.

Syntax:

SIGN(number)

number is the number whose sign is to be determined.

Example:

SIGN(3.4)

returns 1.

SIGN(-4.5)

returns -1.

SIGN(0)

returns 0.

See also:

ABS

Mathematical functions

Personal tools