GNU Octave 10.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 
Loading...
Searching...
No Matches
r1mach.f
Go to the documentation of this file.
1c Copyright (C) 1993-2025 The Octave Project Developers
2c
3c See the file COPYRIGHT.md in the top-level directory of this
4c distribution or <https://octave.org/copyright/>.
5c
6c This file is part of Octave.
7c
8c Octave is free software: you can redistribute it and/or modify it
9c under the terms of the GNU General Public License as published by
10c the Free Software Foundation, either version 3 of the License, or
11c (at your option) any later version.
12c
13c Octave is distributed in the hope that it will be useful, but
14c WITHOUT ANY WARRANTY; without even the implied warranty of
15c MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16c GNU General Public License for more details.
17c
18c You should have received a copy of the GNU General Public License
19c along with Octave; see the file COPYING. If not, see
20c <https://www.gnu.org/licenses/>.
21c
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