Programmer Guide/Command Reference/EVAL/sign: Difference between revisions
From STX Wiki
< Programmer Guide | Command Reference | EVAL
Jump to navigationJump to search
m (1 revision: Initial import) |
No edit summary |
||
Line 1: | Line 1: | ||
{{DISPLAYTITLE:{{SUBPAGENAME}}}} | {{DISPLAYTITLE:{{SUBPAGENAME}}}} | ||
Compute the sign. | |||
;Usage: '''<code>sign(<var>x</var>)</code>''' | |||
:;<var>x</var>: a scalar, vector or matrix | |||
;Result: The result ''r'' has the same type as the argument ''x''. | |||
::<code>''x''[''i'',''j''] is set to 1 if ''x''[''i'',''j'']>=0 and to -1 if ''x''[''i'',''j'']>=0</code> | |||
;See also: [[Programmer_Guide/Command_Reference/EVAL/int|int]], [[Programmer_Guide/Command_Reference/EVAL/round|round]], [[Programmer_Guide/Command_Reference/EVAL/floor|floor]] | |||
[[Programmer_Guide/Command_Reference/EVAL#Functions|<function list>]] | |||
Revision as of 11:56, 4 April 2011
Compute the sign.
- Usage
sign(x)
- x
- a scalar, vector or matrix
- Result
- The result r has the same type as the argument x.
x[i,j] is set to 1 if x[i,j]>=0 and to -1 if x[i,j]>=0