Programmer Guide/SPU Reference/ABS: Difference between revisions

From STX Wiki
Jump to navigationJump to search
No edit summary
No edit summary
Line 1: Line 1:
{{DISPLAYTITLE:{{SUBPAGENAME}}}}
{{DISPLAYTITLE:{{SUBPAGENAME}}}}
Absolute value.
Absolute value.
;<code>[SPU ABS <var>a</var> OUT <var>y</var>]</code>:  
;<code>[SPU ABS <var>A</var> OUT <var>Y</var>]</code>:  
:;<var>a</var>: a scalar or a vector
:{|class="keinrahmen"
:;<var>y</var>: same type as <var>a</var>
|if <var>A</var> is a number || &rarr; || <var>Y</var> = |<var>A</var>|
 
|-
 
|if <var>A</var> is a vector || &rarr; || <var>Y</var>[i] = |<var>A</var>[i]|
Compute the absolute value of input <var>A</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]|


=====Usage:=====
=====Usage:=====

Revision as of 10:37, 28 April 2011

Absolute value.

[SPU ABS A OUT Y]
if A is a number 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).

Navigation menu

Personal tools