annotate scripts/deprecated/bitmax.m @ 20544:cd4a8b4631da

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