Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
5.3.3 - Français

Change language to:
English - 日本語 - 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

Aide Scilab >> Fonctions Elémentaires > Mathématiques discrètes > rat

rat

approximation rationnelle d'un flottant

Séquence d'appel

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

Paramètres

X

vecteur ou matrice réelle

X

scalaire positif réel. Valeur par défaut: 1d-6.

N

vecteur ou matrice d'entiers

D

vecteur ou matrice d'entiers

Y

vecteur ou matrice réelle

Description

[N,D] = rat(X,tol) renvoie deux matrices entières telles que N./D est proche de X au sens où abs(N./D - X) <= tol*norm(X,1)*abs(X).

y = rat(x,tol) renvoie le quotient N./D

Les approximations rationnelles sont obtenues par troncature d'un développement en fraction continue.

Exemples

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

Voir aussi

  • int — arrondi vers zéro
  • round — Arrondi à l'entier le plus proche
<< perms Mathématiques discrètes binomial >>

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 Oct 05 12:10:36 CEST 2011