Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
6.0.1 - 日本語

Change language to:
English - Français - Português - Русский

Please note that the recommended version of Scilab is 2025.0.0. This page might be outdated.
See the recommended documentation of this function

Scilabヘルプ >> Elementary Functions > Floating point > round

round

最も近い整数に丸める

呼び出し手順

y=round(x)

引数

x

実数または複素数の行列r

y

整数値の行列 (または実部と虚部が整数の複素数行列)

説明

round(x)x の要素を最も近い整数に丸めます.

中間の場合,この関数は無限大方向に丸めます. これは,xが正で2つの整数の中間の場合, round(x)%inf方向に 丸められます. xが負で2つの整数の中間の場合, round(x)-%inf方向に 丸められます. 言い換えると,xが正の場合, round(x)int(x+0.5)に等しく, xが負の場合, round(x)int(x-0.5)に等しくなります.

// Notice that round(1.5)==2
round([1.3 1.5 1.7 2.5 3.7])
// Notice the result for x negative
// Notice that round(-1.5)==-2
round([-1.3 -1.5 -1.7 -2.5 -3.7])
round([2.2+%i*23, %pi*%i, -%i ])

参照

  • int — ゼロ方向への丸め
  • floor — 下方向への丸め
  • ceil — 切り上げ
Report an issue
<< number_properties Floating point Integer representation >>

Copyright (c) 2022-2024 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Mon Feb 12 23:12:40 CET 2018