next up previous contents
Next: round2z Up: リファレンスマニュアル Previous: rotateUp

  
round

【目的】
round - 最も近い整数への丸め
【形式】
y = round(x)
   (Real|Complex|Polynomial|Rational) y;
   (Real|Complex|Polynomial|Rational) x;
  
Y = round(X)
   (Matrix|Array|Index) Y;
   (Matrix|Array|index) X;
【詳細】
実数 x について,round(x)は,x を最も近い整数に丸める。複素数 x について,round(x) は,x の実部と虚部をそれぞれ最も近い整数に丸 める。(多項式|有理多項式) x にについて,round(x) は,x の各係数 を最も近い整数に丸める。 round(X)は,(行列|配列|指数) X の各成分に round(X(i,j)) を作用した 結果からなる(行列|配列|指数) を求める。Y の大きさは X の大きさと 同じになる。
【例題】
>> y = round(3.14)
y = 3
>> y = round((3.14, 2.6))
y = (3,3)
>> s = Polynomial("s");
>> y = round(2.1*s + 3.6)
y = 2 s + 4
>> Y = round([1.2 3.4 5.6])
=== [Y] : (  1,  3) ===
           (  1)           (  2)           (  3)     
(  1)  1.00000000E+00  3.00000000E+00  6.00000000E+00
【参照】
fix(2.71), floor(2.74), ceil(2.28), round2z(2.189),


Masanobu KOGA 平成11年10月2日