Mercurial > hg > octave-nkf
comparison scripts/specfun/pow2.m @ 3426:f8dde1807dee
[project @ 2000-01-13 08:40:00 by jwe]
author | jwe |
---|---|
date | Thu, 13 Jan 2000 08:40:53 +0000 |
parents | 5e0a0b1cba43 |
children | 434790acb067 |
comparison
equal
deleted
inserted
replaced
3425:8625164a0a39 | 3426:f8dde1807dee |
---|---|
1 ## Copyright (C) 1995, 1996 Kurt Hornik | 1 ## Copyright (C) 1995, 1996 Kurt Hornik |
2 ## | 2 ## |
3 ## This program is free software; you can redistribute it and/or modify | 3 ## This program is free software; you can redistribute it and/or modify |
4 ## it under the terms of the GNU General Public License as published by | 4 ## it under the terms of the GNU General Public License as published by |
5 ## the Free Software Foundation; either version 2, or (at your option) | 5 ## the Free Software Foundation; either version 2, or (at your option) |
6 ## any later version. | 6 ## any later version. |
7 ## | 7 ## |
8 ## This program is distributed in the hope that it will be useful, but | 8 ## This program is distributed in the hope that it will be useful, but |
9 ## WITHOUT ANY WARRANTY; without even the implied warranty of | 9 ## WITHOUT ANY WARRANTY; without even the implied warranty of |
10 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 10 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
11 ## General Public License for more details. | 11 ## General Public License for more details. |
12 ## | 12 ## |
13 ## You should have received a copy of the GNU General Public License | 13 ## You should have received a copy of the GNU General Public License |
14 ## along with this file. If not, write to the Free Software Foundation, | 14 ## along with this file. If not, write to the Free Software Foundation, |
15 ## 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 15 ## 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
16 | 16 |
17 ## -*- texinfo -*- | 17 ## -*- texinfo -*- |
41 ## Author: AW <Andreas.Weingessel@ci.tuwien.ac.at> | 41 ## Author: AW <Andreas.Weingessel@ci.tuwien.ac.at> |
42 ## Created: 17 October 1994 | 42 ## Created: 17 October 1994 |
43 ## Adapted-By: jwe | 43 ## Adapted-By: jwe |
44 | 44 |
45 function y = pow2 (f, e) | 45 function y = pow2 (f, e) |
46 | 46 |
47 if (nargin == 1) | 47 if (nargin == 1) |
48 y = 2 .^ f; | 48 y = 2 .^ f; |
49 elseif (nargin == 2) | 49 elseif (nargin == 2) |
50 y = f .* (2 .^ e); | 50 y = f .* (2 .^ e); |
51 else | 51 else |