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}}}}
Simple unary operators
Absolute value.
;<code>[SPU ABS <var>a</var> OUT <var>y</var>]</code>:
:;<var>a</var>: a scalar or a vector
:;<var>y</var>: same type as <var>a</var>


:;<code>[SPU ABS <var>a</var> OUT <var>y</var>]</code>:


Compute the absolute value of input <var>A</var>.
Compute the absolute value of input <var>A</var>.

Revision as of 10:34, 28 April 2011

Absolute value.

[SPU ABS a OUT y]
a
a scalar or a vector
y
same type as a


Compute the absolute value of input A. If A is a number: y = |A| If A is a vector: y[i] = |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