view libcruft/misc/r1mach.f @ 13059:107651f79e06

codesprint: 9 tests for hamming.m
author Andriy Shinkarchuck <adriano32.gnu@gmail.com>
date Sat, 03 Sep 2011 12:40:21 -0500
parents 32b15d5c3147
children
line wrap: on
line source

      double precision function r1mach (i)
      integer i
      logical init
      double precision rmach(5)
      double precision slamch
      external slamch
      save init, rmach
      data init /.false./
      if (.not. init) then
        rmach(1) = slamch ('u')
        rmach(2) = slamch ('o')
        rmach(3) = slamch ('e')
        rmach(4) = slamch ('p')
        rmach(5) = log10 (slamch ('b'))
        init = .true.
      endif
      if (i .lt. 1 .or. i .gt. 5) goto 999
      r1mach = rmach(i)
      return
  999 write (*, 1999) i
 1999 format (' r1mach - i out of bounds', i10)
      call xstopx (' ')
      d1mach = 0
      end