~ubuntu-branches/ubuntu/hoary/scilab/hoary

« back to all changes in this revision

Viewing changes to macros/m2sci/%log2sci.sci

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2005-01-09 22:58:21 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050109225821-473xr8vhgugxxx5j
Tags: 3.0-12
changed configure.in to build scilab's own malloc.o, closes: #255869

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
function [stk,txt,top]=%log2sci()
2
 
//
3
 
//!
4
 
// Copyright INRIA
5
 
txt=[]
6
 
iop=evstr(op(2))
7
 
s2=stk(top);s1=stk(top-1);top=top-1
8
 
 
9
 
 
10
 
if s2(2)=='2'|s2(2)=='3' then s2(1)='('+s2(1)+')',end
11
 
if s1(2)=='2'|s1(2)=='3' then s1(1)='('+s1(1)+')',end
12
 
 
13
 
if s1(5)=='4'&s2(5)<>'4' then 
14
 
  if s2(1)=='1' then
15
 
    s2(1)='%t'
16
 
  elseif s2(1)=='0' then
17
 
    s2(1)='%f'
18
 
  else
19
 
    s2(1)=s2(1)+'==1';
20
 
  end
21
 
end
22
 
 
23
 
if s1(5)<>'4'&s2(5)=='4' then 
24
 
  if s1(1)=='1' then
25
 
    s1(1)='%t'
26
 
  elseif s1(1)=='0' then
27
 
    s1(1)='%f'
28
 
  else
29
 
    s1(1)=s1(1)+'==1';
30
 
  end
31
 
end
32
 
 
33
 
 
34
 
 
35
 
// special case for nargout.
36
 
 
37
 
if s1(1)=='nargout'&s2(1)=='0' then
38
 
  s2(1)='1'
39
 
elseif s2(1)=='nargout'&s1(1)=='0' then
40
 
  s1(1)='1'
41
 
end
42
 
 
43
 
if s1(3)=='1'&s1(4)=='1' then
44
 
  stk=list(s1(1)+ops(iop,1)+s2(1),'3',s2(3),s2(4),'4')
45
 
elseif s2(3)=='1'&s2(4)=='1' then
46
 
  stk=list(s1(1)+ops(iop,1)+s2(1),'3',s1(3),s1(4),'4')
47
 
else
48
 
  stk=list(s1(1)+ops(iop,1)+s2(1),'3',s1(3),s1(4),'4')
49
 
end
50
 
 
51
 
 
52
 
 
53