Programmer Guide/SPU Reference/ABS: Difference between revisions
From STX Wiki
Jump to navigationJump to search
No edit summary |
No edit summary |
||
Line 3: | Line 3: | ||
;<code>[SPU ABS <var>A</var> OUT <var>Y</var>]</code>: | ;<code>[SPU ABS <var>A</var> OUT <var>Y</var>]</code>: | ||
:{|class="keinrahmen" | :{|class="keinrahmen" | ||
|if <var>A</var> is a number || → || <var>Y</var> = | |if <var>A</var> is a number || → || <var>Y</var> = <var>A</var> | ||
|- | |- | ||
|if <var>A</var> is a vector || → || <var>Y</var>[i] = |<var>A</var>[i]| | |if <var>A</var> is a vector || → || <var>Y</var>[i] = |<var>A</var>[i]| |
Revision as of 10:44, 28 April 2011
Absolute value.
[SPU ABS A OUT Y]
if A is a number → Y = A if A is a vector → A[i]|
Usage:
ABS A
Inputs:
- A
- A number or vector.
Outputs:
- Y
- A number or vector (same as type of A).