~ubuntu-branches/ubuntu/karmic/scilab/karmic

« back to all changes in this revision

Viewing changes to macros/int/%i_j_s.sci

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2002-03-21 16:57:43 UTC
  • Revision ID: james.westby@ubuntu.com-20020321165743-e9mv12c1tb1plztg
Tags: upstream-2.6
ImportĀ upstreamĀ versionĀ 2.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
function r=%i_j_s(a,n)
 
2
if or(int(n)<>n)|or(n<0) then
 
3
  r=double(a).^n
 
4
else
 
5
  if size(a,'*')==1 then
 
6
    r=iconvert(double(a).^n,inttype(a))
 
7
  else
 
8
    if size(n,'*')<>1 then
 
9
      error(43)
 
10
    else
 
11
      r=a
 
12
      for i=2:n,r=r.*a,end
 
13
    end
 
14
  end
 
15
end