Mercurial > hg > octave-nkf
annotate scripts/deprecated/bitmax.m @ 20830:b65888ec820e draft default tip gccjit
dmalcom gcc jit import
author | Stefan Mahr <dac922@gmx.de> |
---|---|
date | Fri, 27 Feb 2015 16:59:36 +0100 |
parents | cd4a8b4631da |
children |
rev | line source |
---|---|
20696 | 1 ## Copyright (C) 2004-2015 John W. Eaton |
2 ## | |
3 ## This file is part of Octave. | |
4 ## | |
5 ## Octave is free software; you can redistribute it and/or modify it | |
6 ## under the terms of the GNU General Public License as published by | |
7 ## the Free Software Foundation; either version 3 of the License, or (at | |
8 ## your option) any later version. | |
9 ## | |
10 ## Octave is distributed in the hope that it will be useful, but | |
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 ## General Public License for more details. | |
14 ## | |
15 ## You should have received a copy of the GNU General Public License | |
16 ## along with Octave; see the file COPYING. If not, see | |
17 ## <http://www.gnu.org/licenses/>. | |
18 | |
19 ## -*- texinfo -*- | |
20 ## @deftypefn {Function File} {@var{r} =} bitmax (@var{precision}) | |
21 ## | |
20719
cd4a8b4631da
bitmax.m: Correct docstring to say function will be removed in version 4.6.
Rik <rik@octave.org>
parents:
20696
diff
changeset
|
22 ## @code{bitmax} is deprecated and will be removed in Octave version 4.6. |
20696 | 23 ## Use @code{flintmax (precision) - 1} for the equivalent functionality. |
24 ## | |
25 ## Return the largest integer @var{r} that can be represented within a | |
26 ## floating point value. | |
27 ## | |
28 ## The default class is @qcode{"double"}, but @qcode{"single"} is a valid | |
29 ## option. On IEEE 754 compatible systems, @code{bitmax} is | |
30 ## @w{@math{2^{53} - 1}} for @qcode{"double"} and @w{@math{2^{24} - 1}} for | |
31 ## @qcode{"single"}. | |
32 ## | |
33 ## @seealso{flintmax, intmax, realmax, realmin} | |
34 ## @end deftypefn | |
35 | |
36 ## Deprecated in version 4.2 | |
37 | |
38 function r = bitmax (precision) | |
39 | |
40 persistent warned = false; | |
41 if (! warned) | |
42 warned = true; | |
43 warning ("Octave:deprecated-function", | |
44 "bitmax is obsolete and will be removed from a future version of Octave, please use flintmax instead"); | |
45 endif | |
46 | |
47 if (nargin == 0) | |
48 precision = "double"; | |
49 endif | |
50 r = flintmax (precision) - 1; | |
51 | |
52 endfunction |