Programmer Guide/SPU Reference/ROUND: Difference between revisions

From STX Wiki
Jump to navigationJump to search
m (1 revision: Initial import)
No edit summary
 
Line 1: Line 1:
{{DISPLAYTITLE:{{SUBPAGENAME}}}}
{{DISPLAYTITLE:{{SUBPAGENAME}}}}
====ROUND====
Round <var>A</var> to nearest integer.
 
==<code>[SPU ROUND <var>A</var> OUT <var>Y</var>]</code>==
=====Usage:=====
{|class="einrahmen"
 
!In !!Out !!Description
<code>ROUND <var>a</var></code>
 
=====Inputs:=====
 
{|
|-
|-
|a
|<var>A<sub>number</sub></var>
|number or vector
|<var>Y<sub>number</sub></var>
|}
|<var>Y</var> = int(<var>A</var>)
 
=====Outputs:=====
 
{|
|-
|-
|<var>y</var>
|<var>A<sub>vector</sub></var>
|number or vector (same type as a)
|<var>Y<sub>vector</sub></var>
|<var>Y</var>[i] = int(<var>A</var>[i])
|}
|}
 
with: 0 &le; i &lt; length of <var>A<sub>vector</sub></var>
=====Function:=====
;See also:
 
<[[../#Signal Processing Atoms|SP-atoms]]>
Convert input <var>a</var> to integer. The number is rounded according to the fractional part.
<!-- AN, 2.5.2011 -->
 
if <var>a</var> is a number: <var>y</var> = Int(<var>a</var> + 1/2)
 
if <var>a</var> is a vector: <var>y</var>[i] = Int(<var>a</var>[i] + 1/2)
 
The output <var>y</var>|<var>y</var>[i] is a float number|vector with integer value|s

Latest revision as of 11:57, 2 May 2011

Round A to nearest integer.

[SPU ROUND A OUT Y]

In Out Description
Anumber Ynumber Y = int(A)
Avector Yvector Y[i] = int(A[i])

with: 0 ≤ i < length of Avector

See also

<SP-atoms>

Navigation menu

Personal tools