Programmer Guide/SPU Reference/ABS: Difference between revisions

From STX Wiki
Jump to navigationJump to search
No edit summary
No edit summary
Line 2: Line 2:
Simple unary operators
Simple unary operators


:;<code>[ABS <var>a</var> OUT <var>y</var>]</code>:  
:;<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:32, 28 April 2011

Simple unary operators

[SPU ABS a OUT y]

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