File: israt.f

package info (click to toggle)
scilab 4.0-12
  • links: PTS
  • area: non-free
  • in suites: etch, etch-m68k
  • size: 100,640 kB
  • ctags: 57,333
  • sloc: ansic: 377,889; fortran: 242,862; xml: 179,819; tcl: 42,062; sh: 10,593; ml: 9,441; makefile: 4,377; cpp: 1,354; java: 621; csh: 260; yacc: 247; perl: 130; lex: 126; asm: 72; lisp: 30
file content (42 lines) | stat: -rw-r--r-- 1,195 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
      logical function  israt(il,ilnum,ilden,ildom)
c     given a scilab variable stored in the stack, beginning at istk(il)
c     israt checks is this variable is a rational fraction
c     if ok it also returns ilnum and ilden the adress of the beginning
c     of the variables (in istk) containing the numerator and the denominator

c     Copyright INRIA
      INCLUDE '../stack.h'
      integer iadr, sadr
c     
      iadr(l)=l+l-1
      sadr(l)=(l/2)+1
c     
      israt=.false.

c     check if variable is a mlist or tlist (for compatibility)
      if(istk(il).ne.16.and.istk(il).ne.17) return

c     check if mlist has 4 elements
      if(istk(il+1).ne.4) return

c     check if first element is a character string vector
      ll=sadr(il+7)
      ill=iadr(ll)
      if(istk(ill).ne.10) return

c     check if first entry of the character string vector is 'r'
      if(abs(istk(ill+5+istk(ill+1)*istk(ill+2))).ne.27) return

c     check second and third tlist components
      ilnum=iadr(ll+istk(il+3)-1)

      if(istk(ilnum).gt.2) return

      ilden=iadr(ll+istk(il+4)-1)
      if(istk(ilden).gt.2) return

      ildom=iadr(ll+istk(il+5)-1)

      israt=.true.
      return
      end