File: israt.f

package info (click to toggle)
scilab 2.4-1
  • links: PTS
  • area: non-free
  • in suites: potato, slink
  • size: 55,196 kB
  • ctags: 38,019
  • sloc: ansic: 231,970; fortran: 148,976; tcl: 7,099; makefile: 4,585; sh: 2,978; csh: 154; cpp: 101; asm: 39; sed: 5
file content (42 lines) | stat: -rw-r--r-- 1,147 bytes parent folder | download
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 tlist
      if(istk(il).ne.16) return

c     check if tlist 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