Difference between revisions of "Sign"

From MultiCharts
Jump to navigation Jump to search
(Created page with "Returns a numerical value, indicating the sign of the value of the specified numerical expression. A value of 1 is returned for a positive value, -1 is returned for a negativ...")
 
m
 
Line 1: Line 1:
 
Returns a numerical value, indicating the sign of the value of the specified numerical expression.  
 
Returns a numerical value, indicating the sign of the value of the specified numerical expression.  
 +
 
A value of 1 is returned for a positive value, -1 is returned for a negative value, and 0 is returned for the value of 0.  
 
A value of 1 is returned for a positive value, -1 is returned for a negative value, and 0 is returned for the value of 0.  
 
   
 
   
==== Usage ====
+
== Usage ==
<syntaxhighlight>Sign(Value)</syntaxhighlight>  
+
<syntaxhighlight>Sign(Value);</syntaxhighlight>  
 +
 
 +
Where:
  
Where: [[Value]] - a numerical expression  
+
:'''Value''' - a numerical expression.
 
   
 
   
==== Example ====
+
== Examples ==
<syntaxhighlight>Sign(5) will return a value of 1  
+
<syntaxhighlight>Sign(5);</syntaxhighlight>
 +
Will return a value of 1.
  
Sign(-2.85) will return a value of -1  
+
<syntaxhighlight>Sign(-2.85)</syntaxhighlight>
 +
Will return a value of -1.
  
Sign(0) will return a value of 0</syntaxhighlight>
+
<syntaxhighlight>Sign(0)</syntaxhighlight>
 +
Will return a value of 0.
 
   
 
   
 
[[Category:Math and Trig]]
 
[[Category:Math and Trig]]

Latest revision as of 06:31, 9 February 2012

Returns a numerical value, indicating the sign of the value of the specified numerical expression.

A value of 1 is returned for a positive value, -1 is returned for a negative value, and 0 is returned for the value of 0.

Usage

Sign(Value);

Where:

Value - a numerical expression.

Examples

Sign(5);

Will return a value of 1.

Sign(-2.85)

Will return a value of -1.

Sign(0)

Will return a value of 0.