GNU Octave  3.8.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
r1mach.f
Go to the documentation of this file.
1  double precision function r1mach (i)
2  integer i
3  logical init
4  double precision rmach(5)
5  double precision slamch
6  external slamch
7  save init, rmach
8  data init /.false./
9  if (.not. init) then
10  rmach(1) = slamch('u')
11  rmach(2) = slamch('o')
12  rmach(3) = slamch('e')
13  rmach(4) = slamch('p')
14  rmach(5) = log10(slamch('b'))
15  init = .true.
16  endif
17  if (i .lt. 1 .or. i .gt. 5) goto 999
18  r1mach = rmach(i)
19  return
20  999 write (*, 1999) i
21  1999 format (' r1mach - i out of bounds', i10)
22  call xstopx(' ')
23  d1mach = 0
24  end