Difference between revisions of "Sign"

 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
''New to Analytica 4.2''
+
[[Category:Math Functions]]
 
 
= Sign(x) =
 
  
 +
== Sign(x) ==
 
The sign of a number.
 
The sign of a number.
  
Returns:
+
Returns
* -1 when x<0
+
* -1 when «x» < 0
* 0 when x=0
+
* 0 when «x» = 0
* 1 when x>0
+
* 1 when «x» > 0
* [[NaN]] when x is [[NaN]]  (with Warning)
+
* [[NaN]] when «x» is [[NaN]]  (with Warning)
 
 
= Library =
 
  
 +
== Library ==
 
Math
 
Math
  
= Notes =
+
== History ==
 
+
Introduced as a built-in function in [[Analytica 4.2]] .
This function was not built into Analytica until release 4.2.  It was common in 4.1 and earlier to define it as a [[User-Defined Functions|user-defined function]]:
 
Function Sign(x) := if x<0 then -1 else if x>0 then 1 else 0
 
  
= See Also =
+
In Analytica 4.1 and earlier, it was common  to define Sign as a [[User-Defined Functions|user-defined function]]:
 +
:<code>Function Sign(x) := if x < 0 then -1 else if x > 0 then 1 else 0</code>
  
 +
== See Also ==
 
* [[Abs]]
 
* [[Abs]]

Latest revision as of 01:40, 29 January 2016


Sign(x)

The sign of a number.

Returns

  • -1 when «x» < 0
  • 0 when «x» = 0
  • 1 when «x» > 0
  • NaN when «x» is NaN (with Warning)

Library

Math

History

Introduced as a built-in function in Analytica 4.2 .

In Analytica 4.1 and earlier, it was common to define Sign as a user-defined function:

Function Sign(x) := if x < 0 then -1 else if x > 0 then 1 else 0

See Also

Comments


You are not allowed to post comments.