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

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 manual >> Elementary Functions > Discrete mathematics > rat

rat

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

呼び出し手順

[N,D]=rat(x [,tol])
y=rat(x [,tol])

パラメータ

x

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

n

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

d

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

y

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

説明

[N,D] = rat(x,tol) は, abs(N./D - X) <= tol*abs(x)の意味で N./Dxに近くなるような 2つの整数行列を返します. 有理数近似は分数展開を丸めることにより生成されます. デフォルトは tol = 1.e-6*norm(X,1) です. y = rat(x,tol) は商 N./Dを返します.

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

参照

<< primes Discrete mathematics Floating point >>

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:
Wed Jan 26 16:25:03 CET 2011