Mercurial > octave
annotate scripts/strings/dec2base.m @ 27919:1891570abac8
update Octave Project Developers copyright for the new year
In files that have the "Octave Project Developers" copyright notice,
update for 2020.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Mon, 06 Jan 2020 22:29:51 -0500 |
parents | b442ec6dda5c |
children | bd51beb6205e |
rev | line source |
---|---|
27919
1891570abac8
update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents:
27918
diff
changeset
|
1 ## Copyright (C) 2000-2020 The Octave Project Developers |
27918
b442ec6dda5c
use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents:
26986
diff
changeset
|
2 ## |
b442ec6dda5c
use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents:
26986
diff
changeset
|
3 ## See the file COPYRIGHT.md in the top-level directory of this distribution |
b442ec6dda5c
use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents:
26986
diff
changeset
|
4 ## or <https://octave.org/COPYRIGHT.html/>. |
b442ec6dda5c
use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents:
26986
diff
changeset
|
5 ## |
3789 | 6 ## |
7 ## This file is part of Octave. | |
8 ## | |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
9 ## Octave is free software: you can redistribute it and/or modify it |
3789 | 10 ## under the terms of the GNU General Public License as published by |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
11 ## the Free Software Foundation, either version 3 of the License, or |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22540
diff
changeset
|
12 ## (at your option) any later version. |
3789 | 13 ## |
14 ## Octave is distributed in the hope that it will be useful, but | |
15 ## WITHOUT ANY WARRANTY; without even the implied warranty of | |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22540
diff
changeset
|
16 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22540
diff
changeset
|
17 ## GNU General Public License for more details. |
3789 | 18 ## |
19 ## You should have received a copy of the GNU General Public License | |
7016 | 20 ## along with Octave; see the file COPYING. If not, see |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
21 ## <https://www.gnu.org/licenses/>. |
3789 | 22 |
23 ## -*- texinfo -*- | |
20852
516bb87ea72e
2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents:
20164
diff
changeset
|
24 ## @deftypefn {} {} dec2base (@var{d}, @var{base}) |
516bb87ea72e
2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents:
20164
diff
changeset
|
25 ## @deftypefnx {} {} dec2base (@var{d}, @var{base}, @var{len}) |
20164
df437a52bcaf
doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents:
19833
diff
changeset
|
26 ## Return a string of symbols in base @var{base} corresponding to the |
df437a52bcaf
doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents:
19833
diff
changeset
|
27 ## non-negative integer @var{d}. |
3789 | 28 ## |
29 ## @example | |
9051
1bf0ce0930be
Grammar check TexInfo in all .m files
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
30 ## @group |
3789 | 31 ## dec2base (123, 3) |
14327
4d917a6a858b
doc: Use Octave coding conventions in @example blocks of docstrings.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
32 ## @result{} "11120" |
9051
1bf0ce0930be
Grammar check TexInfo in all .m files
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
33 ## @end group |
3789 | 34 ## @end example |
35 ## | |
20164
df437a52bcaf
doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents:
19833
diff
changeset
|
36 ## If @var{d} is a matrix or cell array, return a string matrix with one row |
df437a52bcaf
doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents:
19833
diff
changeset
|
37 ## per element in @var{d}, padded with leading zeros to the width of the |
df437a52bcaf
doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents:
19833
diff
changeset
|
38 ## largest value. |
3789 | 39 ## |
11469
c776f063fefe
Overhaul m-script files to use common variable name between code and documentation.
Rik <octave@nomad.inbox5.com>
parents:
11172
diff
changeset
|
40 ## If @var{base} is a string then the characters of @var{base} are used as |
20164
df437a52bcaf
doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents:
19833
diff
changeset
|
41 ## the symbols for the digits of @var{d}. Space (' ') may not be used as a |
df437a52bcaf
doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents:
19833
diff
changeset
|
42 ## symbol. |
3789 | 43 ## |
44 ## @example | |
9051
1bf0ce0930be
Grammar check TexInfo in all .m files
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
45 ## @group |
3789 | 46 ## dec2base (123, "aei") |
14327
4d917a6a858b
doc: Use Octave coding conventions in @example blocks of docstrings.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
47 ## @result{} "eeeia" |
9051
1bf0ce0930be
Grammar check TexInfo in all .m files
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
48 ## @end group |
3789 | 49 ## @end example |
4492 | 50 ## |
20164
df437a52bcaf
doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents:
19833
diff
changeset
|
51 ## The optional third argument, @var{len}, specifies the minimum number of |
df437a52bcaf
doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents:
19833
diff
changeset
|
52 ## digits in the result. |
11172
7e8ce65f73cf
Overhaul functions used to convert between number bases.
Rik <octave@nomad.inbox5.com>
parents:
11169
diff
changeset
|
53 ## @seealso{base2dec, dec2bin, dec2hex} |
3789 | 54 ## @end deftypefn |
55 | |
3791 | 56 ## Author: Daniel Calvelo <dcalvelo@yahoo.com> |
3789 | 57 ## Adapted-by: Paul Kienzle <pkienzle@kienzle.powernet.co.uk> |
58 | |
11169
51beeeff9027
Update dec2base to handle numbers up to 2^64-1.
Rik <octave@nomad.inbox5.com>
parents:
9844
diff
changeset
|
59 function retval = dec2base (d, base, len) |
3789 | 60 |
4492 | 61 if (nargin < 2 || nargin > 3) |
6046 | 62 print_usage (); |
3789 | 63 endif |
64 | |
13167
f7cb824dc8c0
Allow cellstr inputs for dec2* conversion functions.
Rik <octave@nomad.inbox5.com>
parents:
11587
diff
changeset
|
65 if (iscell (d)) |
f7cb824dc8c0
Allow cellstr inputs for dec2* conversion functions.
Rik <octave@nomad.inbox5.com>
parents:
11587
diff
changeset
|
66 d = cell2mat (d); |
f7cb824dc8c0
Allow cellstr inputs for dec2* conversion functions.
Rik <octave@nomad.inbox5.com>
parents:
11587
diff
changeset
|
67 endif |
f7cb824dc8c0
Allow cellstr inputs for dec2* conversion functions.
Rik <octave@nomad.inbox5.com>
parents:
11587
diff
changeset
|
68 |
17336
b81b9d079515
Use '##' for comments which stand alone on a line.
Rik <rik@octave.org>
parents:
16773
diff
changeset
|
69 ## Create column vector for algorithm |
22540
6574e90e8e27
dec2base.m: avoid check for vectorization, as it is done anyway.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
22323
diff
changeset
|
70 d = d(:); |
19593
446c46af4b42
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
71 |
16773
3542e106c496
dec2base.m: treat logical as double for compatibility with ML (bug #38815).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
14868
diff
changeset
|
72 ## Treat logical as numeric for compatibility with ML |
3542e106c496
dec2base.m: treat logical as double for compatibility with ML (bug #38815).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
14868
diff
changeset
|
73 if (islogical (d)) |
3542e106c496
dec2base.m: treat logical as double for compatibility with ML (bug #38815).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
14868
diff
changeset
|
74 d = double (d); |
3542e106c496
dec2base.m: treat logical as double for compatibility with ML (bug #38815).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
14868
diff
changeset
|
75 elseif (! isnumeric (d) || iscomplex (d) || any (d < 0 | d != fix (d))) |
13167
f7cb824dc8c0
Allow cellstr inputs for dec2* conversion functions.
Rik <octave@nomad.inbox5.com>
parents:
11587
diff
changeset
|
76 error ("dec2base: input must be real non-negative integers"); |
3789 | 77 endif |
78 | |
79 symbols = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; | |
5443 | 80 if (ischar (base)) |
3789 | 81 symbols = base; |
82 base = length (symbols); | |
11169
51beeeff9027
Update dec2base to handle numbers up to 2^64-1.
Rik <octave@nomad.inbox5.com>
parents:
9844
diff
changeset
|
83 if (length (unique (symbols)) != base) |
5407 | 84 error ("dec2base: symbols representing digits must be unique"); |
3789 | 85 endif |
11172
7e8ce65f73cf
Overhaul functions used to convert between number bases.
Rik <octave@nomad.inbox5.com>
parents:
11169
diff
changeset
|
86 if (any (isspace (symbols))) |
7e8ce65f73cf
Overhaul functions used to convert between number bases.
Rik <octave@nomad.inbox5.com>
parents:
11169
diff
changeset
|
87 error ("dec2base: whitespace characters are not valid symbols"); |
7e8ce65f73cf
Overhaul functions used to convert between number bases.
Rik <octave@nomad.inbox5.com>
parents:
11169
diff
changeset
|
88 endif |
4030 | 89 elseif (! isscalar (base)) |
5407 | 90 error ("dec2base: cannot convert from several bases at once"); |
3789 | 91 elseif (base < 2 || base > length (symbols)) |
11169
51beeeff9027
Update dec2base to handle numbers up to 2^64-1.
Rik <octave@nomad.inbox5.com>
parents:
9844
diff
changeset
|
92 error ("dec2base: BASE must be between 2 and 36, or a string of symbols"); |
3789 | 93 endif |
11587
c792872f8942
all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
94 |
5125 | 95 ## determine number of digits required to handle all numbers, can overflow |
96 ## by 1 digit | |
22540
6574e90e8e27
dec2base.m: avoid check for vectorization, as it is done anyway.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
22323
diff
changeset
|
97 max_len = round (log (max (max (d), 1)) / log (base)) + 1; |
4492 | 98 |
99 if (nargin == 3) | |
100 max_len = max (max_len, len); | |
101 endif | |
11587
c792872f8942
all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
102 |
3789 | 103 ## determine digits for each number |
11169
51beeeff9027
Update dec2base to handle numbers up to 2^64-1.
Rik <octave@nomad.inbox5.com>
parents:
9844
diff
changeset
|
104 digits = zeros (length (d), max_len); |
51beeeff9027
Update dec2base to handle numbers up to 2^64-1.
Rik <octave@nomad.inbox5.com>
parents:
9844
diff
changeset
|
105 for k = max_len:-1:1 |
13167
f7cb824dc8c0
Allow cellstr inputs for dec2* conversion functions.
Rik <octave@nomad.inbox5.com>
parents:
11587
diff
changeset
|
106 digits(:,k) = mod (d, base); |
11169
51beeeff9027
Update dec2base to handle numbers up to 2^64-1.
Rik <octave@nomad.inbox5.com>
parents:
9844
diff
changeset
|
107 d = round ((d - digits(:,k)) / base); |
51beeeff9027
Update dec2base to handle numbers up to 2^64-1.
Rik <octave@nomad.inbox5.com>
parents:
9844
diff
changeset
|
108 endfor |
3789 | 109 |
110 ## convert digits to symbols | |
13309
1f075333d9e8
dec2base.m: Code tweaks for slightly better performance.
Rik <octave@nomad.inbox5.com>
parents:
13167
diff
changeset
|
111 retval = reshape (symbols(digits+1), size (digits)); |
3789 | 112 |
21751
b571fc85953f
maint: Use two spaces after period to indicate sentence break.
Rik <rik@octave.org>
parents:
21580
diff
changeset
|
113 ## Check if the first element is the zero symbol. It seems possible |
5133 | 114 ## that LEN is provided, and is less than the computed MAX_LEN and |
115 ## MAX_LEN is computed to be one larger than necessary, so we would | |
116 ## have a leading zero to remove. But if LEN >= MAX_LEN, we should | |
117 ## not remove any leading zeros. | |
118 if ((nargin == 2 || (nargin == 3 && max_len > len)) | |
26986
16d4e3d14213
dec2base.m: Correctly handle zero matrix input (bug #56005).
Rik <rik@octave.org>
parents:
26376
diff
changeset
|
119 && columns (retval) != 1 && ! any (retval(:,1) != symbols(1))) |
5125 | 120 retval = retval(:,2:end); |
121 endif | |
122 | |
3789 | 123 endfunction |
5125 | 124 |
13167
f7cb824dc8c0
Allow cellstr inputs for dec2* conversion functions.
Rik <octave@nomad.inbox5.com>
parents:
11587
diff
changeset
|
125 |
5125 | 126 %!test |
14363
f3d52523cde1
Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents:
14327
diff
changeset
|
127 %! s0 = ""; |
13167
f7cb824dc8c0
Allow cellstr inputs for dec2* conversion functions.
Rik <octave@nomad.inbox5.com>
parents:
11587
diff
changeset
|
128 %! for n = 1:13 |
f7cb824dc8c0
Allow cellstr inputs for dec2* conversion functions.
Rik <octave@nomad.inbox5.com>
parents:
11587
diff
changeset
|
129 %! for b = 2:16 |
f7cb824dc8c0
Allow cellstr inputs for dec2* conversion functions.
Rik <octave@nomad.inbox5.com>
parents:
11587
diff
changeset
|
130 %! pp = dec2base (b^n+1, b); |
14363
f3d52523cde1
Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents:
14327
diff
changeset
|
131 %! assert (dec2base (b^n, b), ['1',s0,'0']); |
f3d52523cde1
Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents:
14327
diff
changeset
|
132 %! assert (dec2base (b^n+1, b), ['1',s0,'1']); |
13309
1f075333d9e8
dec2base.m: Code tweaks for slightly better performance.
Rik <octave@nomad.inbox5.com>
parents:
13167
diff
changeset
|
133 %! endfor |
13167
f7cb824dc8c0
Allow cellstr inputs for dec2* conversion functions.
Rik <octave@nomad.inbox5.com>
parents:
11587
diff
changeset
|
134 %! s0 = [s0,'0']; |
13309
1f075333d9e8
dec2base.m: Code tweaks for slightly better performance.
Rik <octave@nomad.inbox5.com>
parents:
13167
diff
changeset
|
135 %! endfor |
5125 | 136 |
137 %!test | |
14363
f3d52523cde1
Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents:
14327
diff
changeset
|
138 %! digits = "0123456789ABCDEF"; |
13167
f7cb824dc8c0
Allow cellstr inputs for dec2* conversion functions.
Rik <octave@nomad.inbox5.com>
parents:
11587
diff
changeset
|
139 %! for n = 1:13 |
f7cb824dc8c0
Allow cellstr inputs for dec2* conversion functions.
Rik <octave@nomad.inbox5.com>
parents:
11587
diff
changeset
|
140 %! for b = 2:16 |
14363
f3d52523cde1
Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents:
14327
diff
changeset
|
141 %! pm = dec2base (b^n-1, b); |
13167
f7cb824dc8c0
Allow cellstr inputs for dec2* conversion functions.
Rik <octave@nomad.inbox5.com>
parents:
11587
diff
changeset
|
142 %! assert (length (pm), n); |
14363
f3d52523cde1
Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents:
14327
diff
changeset
|
143 %! assert (all (pm == digits(b))); |
13309
1f075333d9e8
dec2base.m: Code tweaks for slightly better performance.
Rik <octave@nomad.inbox5.com>
parents:
13167
diff
changeset
|
144 %! endfor |
1f075333d9e8
dec2base.m: Code tweaks for slightly better performance.
Rik <octave@nomad.inbox5.com>
parents:
13167
diff
changeset
|
145 %! endfor |
5125 | 146 |
147 %!test | |
13167
f7cb824dc8c0
Allow cellstr inputs for dec2* conversion functions.
Rik <octave@nomad.inbox5.com>
parents:
11587
diff
changeset
|
148 %! for b = 2:16 |
f7cb824dc8c0
Allow cellstr inputs for dec2* conversion functions.
Rik <octave@nomad.inbox5.com>
parents:
11587
diff
changeset
|
149 %! assert (dec2base (0, b), '0'); |
13309
1f075333d9e8
dec2base.m: Code tweaks for slightly better performance.
Rik <octave@nomad.inbox5.com>
parents:
13167
diff
changeset
|
150 %! endfor |
5125 | 151 |
14363
f3d52523cde1
Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents:
14327
diff
changeset
|
152 %!assert (dec2base (0, 2, 4), "0000") |
f3d52523cde1
Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents:
14327
diff
changeset
|
153 %!assert (dec2base (2^51-1, 2), ... |
f3d52523cde1
Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents:
14327
diff
changeset
|
154 %! "111111111111111111111111111111111111111111111111111") |
f3d52523cde1
Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents:
14327
diff
changeset
|
155 %!assert (dec2base (uint64 (2)^63-1, 16), "7FFFFFFFFFFFFFFF") |
f3d52523cde1
Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents:
14327
diff
changeset
|
156 %!assert (dec2base ([1, 2; 3, 4], 2, 3), ["001"; "011"; "010"; "100"]) |
f3d52523cde1
Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents:
14327
diff
changeset
|
157 %!assert (dec2base ({1, 2; 3, 4}, 2, 3), ["001"; "011"; "010"; "100"]) |
11169
51beeeff9027
Update dec2base to handle numbers up to 2^64-1.
Rik <octave@nomad.inbox5.com>
parents:
9844
diff
changeset
|
158 |
16773
3542e106c496
dec2base.m: treat logical as double for compatibility with ML (bug #38815).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
14868
diff
changeset
|
159 %!test |
3542e106c496
dec2base.m: treat logical as double for compatibility with ML (bug #38815).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
14868
diff
changeset
|
160 %! a = 0:3; |
21580
ecce63c99c3f
maint: Add semicolons to terminate code in %! blocks.
Rik <rik@octave.org>
parents:
20955
diff
changeset
|
161 %! assert (dec2base (! a, 2, 1), ["1"; "0"; "0"; "0"]); |
16773
3542e106c496
dec2base.m: treat logical as double for compatibility with ML (bug #38815).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
14868
diff
changeset
|
162 |
26986
16d4e3d14213
dec2base.m: Correctly handle zero matrix input (bug #56005).
Rik <rik@octave.org>
parents:
26376
diff
changeset
|
163 %!assert <*56005> (dec2base ([0, 0], 16), ["0"; "0"]) |
16d4e3d14213
dec2base.m: Correctly handle zero matrix input (bug #56005).
Rik <rik@octave.org>
parents:
26376
diff
changeset
|
164 |
19833
9fc020886ae9
maint: Clean up m-files to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
165 ## Test input validation |
11169
51beeeff9027
Update dec2base to handle numbers up to 2^64-1.
Rik <octave@nomad.inbox5.com>
parents:
9844
diff
changeset
|
166 %!error dec2base () |
51beeeff9027
Update dec2base to handle numbers up to 2^64-1.
Rik <octave@nomad.inbox5.com>
parents:
9844
diff
changeset
|
167 %!error dec2base (1) |
51beeeff9027
Update dec2base to handle numbers up to 2^64-1.
Rik <octave@nomad.inbox5.com>
parents:
9844
diff
changeset
|
168 %!error dec2base (1, 2, 3, 4) |
13167
f7cb824dc8c0
Allow cellstr inputs for dec2* conversion functions.
Rik <octave@nomad.inbox5.com>
parents:
11587
diff
changeset
|
169 %!error dec2base ("A") |
f7cb824dc8c0
Allow cellstr inputs for dec2* conversion functions.
Rik <octave@nomad.inbox5.com>
parents:
11587
diff
changeset
|
170 %!error dec2base (2i) |
11169
51beeeff9027
Update dec2base to handle numbers up to 2^64-1.
Rik <octave@nomad.inbox5.com>
parents:
9844
diff
changeset
|
171 %!error dec2base (-1) |
51beeeff9027
Update dec2base to handle numbers up to 2^64-1.
Rik <octave@nomad.inbox5.com>
parents:
9844
diff
changeset
|
172 %!error dec2base (1.1) |
13309
1f075333d9e8
dec2base.m: Code tweaks for slightly better performance.
Rik <octave@nomad.inbox5.com>
parents:
13167
diff
changeset
|
173 %!error dec2base (1, "ABA") |
1f075333d9e8
dec2base.m: Code tweaks for slightly better performance.
Rik <octave@nomad.inbox5.com>
parents:
13167
diff
changeset
|
174 %!error dec2base (1, "A B") |
14868
5d3a684236b0
maint: Use Octave coding conventions for cuddling parentheses in scripts directory
Rik <octave@nomad.inbox5.com>
parents:
14363
diff
changeset
|
175 %!error dec2base (1, ones (2)) |
11169
51beeeff9027
Update dec2base to handle numbers up to 2^64-1.
Rik <octave@nomad.inbox5.com>
parents:
9844
diff
changeset
|
176 %!error dec2base (1, 1) |
51beeeff9027
Update dec2base to handle numbers up to 2^64-1.
Rik <octave@nomad.inbox5.com>
parents:
9844
diff
changeset
|
177 %!error dec2base (1, 37) |