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

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

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

Scilabヘルプ >> Elementary Functions > Discrete mathematics > rat

rat

浮動小数点数の有理数近似

呼び出し手順

[N,D]=rat(X [,tol])

Y=rat(X [,tol])

引数

X

実数のベクトルまたは行列

tol

正の実数スカラー, 許容誤差 (下記参照). デフォルト値は1d-6.

N

整数のベクトルまたは行列

D

整数のベクトルまたは行列

Y

実数のベクトルまたは行列

説明

[N,D] = rat(X,tol) は, abs(N./D - X) <= tol*norm(X,1)*abs(X)の基準で N./DXに近くなるような 2つの整数行列を返します.

y=rat(x,tol) は商 N./Dを返します.

有理数近似は分数展開を丸めることにより生成されます.

[n,d]=rat([3.5, 1.333333,-0.8])
[n,d]=rat(%pi)
[n,d]=rat(%pi,1.d-12)
n/d-%pi

参照

  • int — ゼロ方向への丸め
  • round — 最も近い整数に丸める
Report an issue
<< primes Discrete mathematics elementarymatrices >>

Copyright (c) 2022-2023 (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:
Thu Feb 14 15:02:06 CET 2019