      function aint (x)
c december 1983 edition. w. fullerton, c3, los alamos scientific lab.
c
c aint (x) extracts the integer part of x and returns the result as a
c floating point number.  this routine is ordinarily a built-in
c function.  it is supplied here merely for completeness.
c
      external alog, i1mach, r1mach
      data npart, scale, xbig, xmax / 0, 3*0.0 /
c
      if (npart.ne.0) go to 10
      ibase = i1mach(10)
      xmax = 1.0/r1mach(4)
      xbig = amin1 (float(i1mach(9)), xmax)
      scale = ibase**int (alog(xbig)/alog(float(ibase))-0.5)
      npart = alog (xmax)/alog (scale) + 1.0
c
 10   if (x.lt.(-xbig) .or. x.gt.xbig) go to 20
c
      aint = int(x)
      return
c
 20   xscl = abs(x)
      if (xscl.gt.xmax) go to 50
c
      do 30 i=1,npart
        xscl = xscl/scale
 30   continue
c
      aint = 0.0
      do 40 i=1,npart
        xscl = xscl*scale
        ipart = xscl
        part = ipart
        xscl = xscl - part
        aint = aint*scale + part
 40   continue
c
      if (x.lt.0.0) aint = -aint
      return
c
 50   call seteru (67haint    abs(x) may be too big to be represented as
     1 an exact integer, 67, 1, 1)
      aint = x
      return
c
      end