GNU Octave  9.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
r1mach.f
Go to the documentation of this file.
1 c Copyright (C) 1993-2024 The Octave Project Developers
2 c
3 c See the file COPYRIGHT.md in the top-level directory of this
4 c distribution or <https://octave.org/copyright/>.
5 c
6 c This file is part of Octave.
7 c
8 c Octave is free software: you can redistribute it and/or modify it
9 c under the terms of the GNU General Public License as published by
10 c the Free Software Foundation, either version 3 of the License, or
11 c (at your option) any later version.
12 c
13 c Octave is distributed in the hope that it will be useful, but
14 c WITHOUT ANY WARRANTY; without even the implied warranty of
15 c MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 c GNU General Public License for more details.
17 c
18 c You should have received a copy of the GNU General Public License
19 c along with Octave; see the file COPYING. If not, see
20 c <https://www.gnu.org/licenses/>.
21 c
22  real function r1mach (i)
23  integer i
24  logical init
25  real rmach(5)
26  real slamch
27  external slamch
28  save init, rmach
29  data init /.false./
30  if (.not. init) then
31  rmach(1) = slamch('u')
32  rmach(2) = slamch('o')
33  rmach(3) = slamch('e')
34  rmach(4) = slamch('p')
35  rmach(5) = log10(slamch('b'))
36  init = .true.
37  endif
38  if (i .lt. 1 .or. i .gt. 5) goto 999
39  r1mach = rmach(i)
40  return
41  999 write (*, 1999) i
42  1999 format (' r1mach - i out of bounds', i10)
43  call xstopx (' ')
44  r1mach = 0
45  end
real function r1mach(i)
Definition: r1mach.f:23