Programmer Guide/SPU Reference/ABS: Difference between revisions

From STX Wiki
Jump to navigationJump to search
No edit summary
No edit summary
Line 7: Line 7:
|if <var>A</var> is a vector || &rarr; || <var>Y</var>[i] = <nowiki>|</nowiki><var>A</var>[i]<nowiki>|</nowiki>
|if <var>A</var> is a vector || &rarr; || <var>Y</var>[i] = <nowiki>|</nowiki><var>A</var>[i]<nowiki>|</nowiki>
|}
|}
=====Usage:=====
<code>ABS <var>A</var></code>
=====Inputs:=====
;<var>A</var>
:A number or vector.
=====Outputs:=====
;<var>Y</var>
:A number or vector (same as type of <var>A</var>).

Revision as of 10:56, 28 April 2011

Absolute value.

[SPU ABS A OUT Y]
if A is a number Y = |A|
if A is a vector Y[i] = |A[i]|

Navigation menu

Personal tools