~ubuntu-branches/ubuntu/karmic/scilab/karmic

« back to all changes in this revision

Viewing changes to man/elementary/rat.cat

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2002-03-21 16:57:43 UTC
  • Revision ID: james.westby@ubuntu.com-20020321165743-e9mv12c1tb1plztg
Tags: upstream-2.6
ImportĀ upstreamĀ versionĀ 2.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
rat              Scilab Group              Scilab Function              rat
 
2
NAME
 
3
   rat - Floating point rational approximation 
 
4
  
 
5
CALLING SEQUENCE
 
6
 [N,D]=rat(x [,tol])
 
7
 y=rat(x [,tol])
 
8
PARAMETERS
 
9
 x          : real  vector or matrix
 
10
            
 
11
 n          : integer vector or matrix 
 
12
            
 
13
 d          : integer vector or matrix 
 
14
            
 
15
 y          : real vector or matrix 
 
16
            
 
17
DESCRIPTION
 
18
   [N,D] = rat(x,tol) returns two integer matrices so that N./D is close tox
 
19
  in the sense that abs(N./D - X) <= tol*abs(x). The rational
 
20
  approximations are generated by truncating continued fraction expansions.
 
21
     tol = 1.e-6*norm(X,1) is the default. y = rat(x,tol) return the
 
22
  quotient N./D 
 
23
  
 
24
SEE ALSO
 
25
   int, round
 
26
  
 
27
EXAMPLES
 
28
 [n,d]=rat(%pi)
 
29
 [n,d]=rat(%pi,1.d-12)
 
30
 n/d-%pi