changeset 29818:0511e3638724

maint: merge stable to default.
author Rik <rik@octave.org>
date Thu, 24 Jun 2021 14:47:20 -0700
parents f54cfd60725e (current diff) ba571657651a (diff)
children fc8571a37d21
files libinterp/corefcn/data.cc
diffstat 1 files changed, 19 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/data.cc	Thu Jun 24 13:51:52 2021 -0700
+++ b/libinterp/corefcn/data.cc	Thu Jun 24 14:47:20 2021 -0700
@@ -458,17 +458,32 @@
 
 DEFUN (log2, args, nargout,
        doc: /* -*- texinfo -*-
-@deftypefn  {} {} log2 (@var{x})
+@deftypefn  {} {@var{y} =} log2 (@var{x})
 @deftypefnx {} {[@var{f}, @var{e}] =} log2 (@var{x})
 Compute the base-2 logarithm of each element of @var{x}.
 
-If called with two output arguments, split @var{x} into
-binary mantissa and exponent so that
+If called with one output, compute the base-2 logarithm such that
+@tex
+$2^y = x$.
+@end tex
+@ifnottex
+@code{2^@var{y} = @var{x}}.
+@end ifnottex
+
+If called with two output arguments, split @var{x} into binary mantissa
+(@var{f}) and exponent (@var{e}) such that
+@tex
+$x = f \cdot 2^e$
+@end tex
+@ifnottex
+@code{@var{x} = @var{f} * 2^@var{e}}
+@end ifnottex
+where
 @tex
 ${1 \over 2} \le \left| f \right| < 1$
 @end tex
 @ifnottex
-@w{@code{1/2 <= abs(f) < 1}}
+@w{@code{1/2 <= abs (@var{f}) < 1}}
 @end ifnottex
 and @var{e} is an integer.  If
 @tex