diff scripts/general/bitcmp.m @ 20521:4bb41929286b

Deprecate bitmax. * NEWS: Announce deprecation and replacement functions. * scripts/deprecated/bitmax.m: New function. Add deprecation message to docstring. Add deprecation warning to m-file. * scripts/deprecated/module.mk: Add deprecated versions to build system. * libinterp/corefcn/bitfcns.cc: Remove build-in function. Remove function from docstrings. * libinterp/corefcn/data.cc: Remove function from docstrings. * scripts/general/bitcmp.m: Replace bitmax function calls with flintmax. Remove function from docstrings. * scripts/general/bitget.m: Replace bitmax function calls with flintmax. Remove function from docstrings. * scripts/general/bitset.m: Replace bitmax function calls with flintmax. Remove function from docstrings. * scripts/specfun/factor.m: Replace bitmax function calls with flintmax. Remove function from docstrings. * scripts/statistics/distributions/unidpdf.m: Remove function from docstrings. * scripts/general/num2str.m: Replaced function in comment. * doc/interpreter/doccheck/aspell-octave.en.pws: Remove functions from list. * doc/interpreter/numbers.txi: Remove function from manual.
author Kai T. Ohlhus <k.ohlhus@gmail.com>
date Wed, 09 Sep 2015 18:43:52 +0200
parents 7503499a252b
children
line wrap: on
line diff
--- a/scripts/general/bitcmp.m	Tue Sep 08 10:39:50 2015 +0200
+++ b/scripts/general/bitcmp.m	Wed Sep 09 18:43:52 2015 +0200
@@ -20,7 +20,7 @@
 ## @deftypefn {Function File} {} bitcmp (@var{A}, @var{k})
 ## Return the @var{k}-bit complement of integers in @var{A}.
 ##
-## If @var{k} is omitted @code{k = log2 (bitmax) + 1} is assumed.
+## If @var{k} is omitted @code{k = log2 (flintmax) + 1} is assumed.
 ##
 ## @example
 ## @group
@@ -33,7 +33,7 @@
 ## @end group
 ## @end example
 ##
-## @seealso{bitand, bitor, bitxor, bitset, bitget, bitcmp, bitshift, bitmax}
+## @seealso{bitand, bitor, bitxor, bitset, bitget, bitcmp, bitshift, flintmax}
 ## @end deftypefn
 
 ## Liberally based on the version by Kai Habel from octave-forge
@@ -49,10 +49,10 @@
   endif
 
   if (isa (A, "double"))
-    bmax = bitmax;
+    bmax = flintmax - 1;
     amax = ceil (log2 (bmax));
   elseif (isa (A, "single"))
-    bmax = bitmax ("single");
+    bmax = flintmax ("single") - 1;
     amax = ceil (log2 (bmax));
   elseif (isinteger (A))
     amax = sizeof (ones (1, class (A))) * 8;
@@ -76,14 +76,14 @@
 
 %!test
 %! Amax = 53;
-%! Bmax = bitmax;
+%! Bmax = flintmax - 1;
 %! A = bitshift (Bmax,-2);
 %! assert (bitcmp (A,Amax),bitor (bitshift (1,Amax-1), bitshift (1,Amax-2)));
 %! assert (bitcmp (A,Amax-1), bitshift (1,Amax-2));
 %! assert (bitcmp (A,Amax-2), 0);
 %!test
 %! Amax = 24;
-%! Bmax = bitmax ("single");
+%! Bmax = flintmax ("single") - 1;
 %! A = bitshift (Bmax,-2);
 %! assert (bitcmp (A,Amax),bitor (bitshift (single (1),Amax-1), bitshift (single (1),Amax-2)));
 %! assert (bitcmp (A,Amax-1), bitshift (single (1),Amax-2));