Mercurial > octave
comparison libinterp/corefcn/bitfcns.cc @ 30888:32d2b6604a9f
doc: Ensure documentation lists output argument when it exists for functions in libinterp/
For new users of Octave it is best to show explicit calling forms
in the documentation and to show a return argument when it exists.
* __ftp__.cc, __magick_read__.cc, __pchip_deriv__.cc, bitfcns.cc, bsxfun.cc,
call-stack.cc, cellfun.cc, chol.cc, conv2.cc, data.cc, debug.cc, defaults.cc,
det.cc, dirfns.cc, display.cc, dot.cc, error.cc, event-manager.cc, fft.cc,
fft2.cc, fftn.cc, file-io.cc, getgrent.cc, getpwent.cc, getrusage.cc,
graphics.cc, hash.cc, help.cc, input.cc, interpreter.cc, kron.cc, load-path.cc,
mappers.cc, max.cc, nproc.cc, oct-hist.cc, pager.cc, pinv.cc, psi.cc, rand.cc,
settings.cc, sighandlers.cc, stream-euler.cc, strfns.cc, symtab.cc,
syscalls.cc, sysdep.cc, time.cc, toplev.cc, utils.cc, variables.cc,
__fltk_uigetfile__.cc, audiodevinfo.cc, audioread.cc, fftw.cc, ov-bool-mat.cc,
ov-cell.cc, ov-class.cc, ov-classdef.cc, ov-fcn-handle.cc, ov-java.cc,
ov-struct.cc, ov-typeinfo.cc, ov-usr-fcn.cc, ov.cc, octave.cc, profiler.cc:
Add return arguments to @deftypefn macros where they were missing.
Attempt to use standard naming convention for return variables.
Occasionally improved the docstring itself by re-wording or adding code
examples.
author | Rik <rik@octave.org> |
---|---|
date | Mon, 04 Apr 2022 10:31:48 -0700 |
parents | 796f54d4ddbf |
children | e88a07dec498 |
comparison
equal
deleted
inserted
replaced
30887:4bab8d3fce79 | 30888:32d2b6604a9f |
---|---|
359 return retval; | 359 return retval; |
360 } | 360 } |
361 | 361 |
362 DEFUN (bitand, args, , | 362 DEFUN (bitand, args, , |
363 doc: /* -*- texinfo -*- | 363 doc: /* -*- texinfo -*- |
364 @deftypefn {} {} bitand (@var{x}, @var{y}) | 364 @deftypefn {} {@var{z} =} bitand (@var{x}, @var{y}) |
365 Return the bitwise AND of non-negative integers. | 365 Return the bitwise AND of non-negative integers. |
366 | 366 |
367 @var{x}, @var{y} must be in the range [0,intmax] | 367 @var{x}, @var{y} must be in the range [0,intmax] |
368 @seealso{bitor, bitxor, bitset, bitget, bitcmp, bitshift, intmax, flintmax} | 368 @seealso{bitor, bitxor, bitset, bitget, bitcmp, bitshift, intmax, flintmax} |
369 @end deftypefn */) | 369 @end deftypefn */) |
375 %!# Function bitand is tested as part of bitxor BIST tests | 375 %!# Function bitand is tested as part of bitxor BIST tests |
376 */ | 376 */ |
377 | 377 |
378 DEFUN (bitor, args, , | 378 DEFUN (bitor, args, , |
379 doc: /* -*- texinfo -*- | 379 doc: /* -*- texinfo -*- |
380 @deftypefn {} {} bitor (@var{x}, @var{y}) | 380 @deftypefn {} {@var{z} =} bitor (@var{x}, @var{y}) |
381 Return the bitwise OR of non-negative integers @var{x} and @var{y}. | 381 Return the bitwise OR of non-negative integers @var{x} and @var{y}. |
382 | 382 |
383 @seealso{bitor, bitxor, bitset, bitget, bitcmp, bitshift, intmax, flintmax} | 383 @seealso{bitor, bitxor, bitset, bitget, bitcmp, bitshift, intmax, flintmax} |
384 @end deftypefn */) | 384 @end deftypefn */) |
385 { | 385 { |
390 %!# Function bitor is tested as part of bitxor BIST tests | 390 %!# Function bitor is tested as part of bitxor BIST tests |
391 */ | 391 */ |
392 | 392 |
393 DEFUN (bitxor, args, , | 393 DEFUN (bitxor, args, , |
394 doc: /* -*- texinfo -*- | 394 doc: /* -*- texinfo -*- |
395 @deftypefn {} {} bitxor (@var{x}, @var{y}) | 395 @deftypefn {} {@var{z} =} bitxor (@var{x}, @var{y}) |
396 Return the bitwise XOR of non-negative integers @var{x} and @var{y}. | 396 Return the bitwise XOR of non-negative integers @var{x} and @var{y}. |
397 | 397 |
398 @seealso{bitand, bitor, bitset, bitget, bitcmp, bitshift, intmax, flintmax} | 398 @seealso{bitand, bitor, bitset, bitget, bitcmp, bitshift, intmax, flintmax} |
399 @end deftypefn */) | 399 @end deftypefn */) |
400 { | 400 { |
534 } \ | 534 } \ |
535 while (0) | 535 while (0) |
536 | 536 |
537 DEFUN (bitshift, args, , | 537 DEFUN (bitshift, args, , |
538 doc: /* -*- texinfo -*- | 538 doc: /* -*- texinfo -*- |
539 @deftypefn {} {} bitshift (@var{a}, @var{k}) | 539 @deftypefn {} {@var{B} =} bitshift (@var{A}, @var{k}) |
540 @deftypefnx {} {} bitshift (@var{a}, @var{k}, @var{n}) | 540 @deftypefnx {} {@var{B} =} bitshift (@var{A}, @var{k}, @var{n}) |
541 Return a @var{k} bit shift of @var{n}-digit unsigned integers in @var{a}. | 541 Return a @var{k} bit shift of @var{n}-digit unsigned integers in @var{A}. |
542 | 542 |
543 A positive @var{k} leads to a left shift; A negative value to a right shift. | 543 A positive @var{k} leads to a left shift; A negative value to a right shift. |
544 | 544 |
545 If @var{n} is omitted it defaults to 64. | 545 If @var{n} is omitted it defaults to 64. @var{n} must be in the range [1,64]. |
546 @var{n} must be in the range [1,64]. | |
547 | 546 |
548 @example | 547 @example |
549 @group | 548 @group |
550 bitshift (eye (3), 1) | 549 bitshift (eye (3), 1) |
551 @result{} | 550 @result{} |
656 %!error <N must be positive> bitshift (10, [-2 -1 0 1 2], -1) | 655 %!error <N must be positive> bitshift (10, [-2 -1 0 1 2], -1) |
657 */ | 656 */ |
658 | 657 |
659 DEFUN (flintmax, args, , | 658 DEFUN (flintmax, args, , |
660 doc: /* -*- texinfo -*- | 659 doc: /* -*- texinfo -*- |
661 @deftypefn {} {} flintmax () | 660 @deftypefn {} {@var{Imax} =} flintmax () |
662 @deftypefnx {} {} flintmax ("double") | 661 @deftypefnx {} {@var{Imax} =} flintmax ("double") |
663 @deftypefnx {} {} flintmax ("single") | 662 @deftypefnx {} {@var{Imax} =} flintmax ("single") |
664 @deftypefnx {} {} flintmax (@var{var}) | 663 @deftypefnx {} {@var{Imax} =} flintmax (@var{var}) |
665 Return the largest integer that can be represented consecutively in a | 664 Return the largest integer that can be represented consecutively in a |
666 floating point value. | 665 floating point value. |
667 | 666 |
668 The input is either a string specifying a floating point type, or it is an | 667 The input is either a string specifying a floating point type, or it is an |
669 existing floating point variable @var{var}. | 668 existing floating point variable @var{var}. |
724 %!error <not defined for class 'char'> flintmax ("char") | 723 %!error <not defined for class 'char'> flintmax ("char") |
725 */ | 724 */ |
726 | 725 |
727 DEFUN (intmax, args, , | 726 DEFUN (intmax, args, , |
728 doc: /* -*- texinfo -*- | 727 doc: /* -*- texinfo -*- |
729 @deftypefn {} {} intmax () | 728 @deftypefn {} {@var{Imax} =} intmax () |
730 @deftypefnx {} {} intmax ("@var{type}") | 729 @deftypefnx {} {@var{Imax} =} intmax ("@var{type}") |
731 @deftypefnx {} {} intmax (@var{var}) | 730 @deftypefnx {} {@var{Imax} =} intmax (@var{var}) |
732 Return the largest integer that can be represented by a specific integer type. | 731 Return the largest integer that can be represented by a specific integer type. |
733 | 732 |
734 The input is either a string @qcode{"@var{type}"} specifying an integer type, | 733 The input is either a string @qcode{"@var{type}"} specifying an integer type, |
735 or it is an existing integer variable @var{var}. | 734 or it is an existing integer variable @var{var}. |
736 | 735 |
838 %!error <not defined for 'char' objects> intmax ("char") | 837 %!error <not defined for 'char' objects> intmax ("char") |
839 */ | 838 */ |
840 | 839 |
841 DEFUN (intmin, args, , | 840 DEFUN (intmin, args, , |
842 doc: /* -*- texinfo -*- | 841 doc: /* -*- texinfo -*- |
843 @deftypefn {} {} intmin () | 842 @deftypefn {} {@var{Imin} =} intmin () |
844 @deftypefnx {} {} intmin ("@var{type}") | 843 @deftypefnx {} {@var{Imin} =} intmin ("@var{type}") |
845 @deftypefnx {} {} intmin (@var{var}) | 844 @deftypefnx {} {@var{Imin} =} intmin (@var{var}) |
846 Return the smallest integer that can be represented by a specific integer type. | 845 Return the smallest integer that can be represented by a specific integer type. |
847 | 846 |
848 The input is either a string @qcode{"@var{type}"} specifying an integer type, | 847 The input is either a string @qcode{"@var{type}"} specifying an integer type, |
849 or it is an existing integer variable @var{var}. | 848 or it is an existing integer variable @var{var}. |
850 | 849 |
952 %!error <not defined for 'char' objects> intmin ("char") | 951 %!error <not defined for 'char' objects> intmin ("char") |
953 */ | 952 */ |
954 | 953 |
955 DEFUN (sizemax, args, , | 954 DEFUN (sizemax, args, , |
956 doc: /* -*- texinfo -*- | 955 doc: /* -*- texinfo -*- |
957 @deftypefn {} {} sizemax () | 956 @deftypefn {} {@var{max_numel} =} sizemax () |
958 Return the largest value allowed for the size of an array. | 957 Return the largest value allowed for the size of an array. |
959 | 958 |
960 If Octave is compiled with 64-bit indexing, the result is of class int64, | 959 If Octave is compiled with 64-bit indexing, the result is of class int64, |
961 otherwise it is of class int32. The maximum array size is slightly | 960 otherwise it is of class int32. The maximum array size is slightly smaller |
962 smaller than the maximum value allowable for the relevant class as reported | 961 than the maximum value allowable for the relevant class as reported by |
963 by @code{intmax}. | 962 @code{intmax}. |
964 @seealso{intmax} | 963 @seealso{intmax} |
965 @end deftypefn */) | 964 @end deftypefn */) |
966 { | 965 { |
967 if (args.length () != 0) | 966 if (args.length () != 0) |
968 print_usage (); | 967 print_usage (); |