Back to index

texmacs  1.0.7.15
num2scm.m
Go to the documentation of this file.
00001 ## Released under the GNU General Public License, see www.gnu.org
00002 ## Copyright (C) 2002 by the Free Software Foundation
00003 ## Written by Michael Graffam mikegraffam@yahoo.com
00004 ##
00005 ## Convert a number to a Scheme string
00006 ## Created: Sept 2002
00007 
00008 function tmp=num2scm(n)
00009        tmp="(with \"mode\" \"math\" \"";
00010        if (isreal(n))
00011               tmp=[tmp, num2str(n), "\")"];
00012        else
00013               if (real(n) != 0)
00014                      if (imag(n)>=0)
00015                             op="+";
00016                      else
00017                             op="-";
00018                      endif
00019                      tmp=["(with \"mode\" \"math\" \"", num2str(real(n)),op,num2str(abs(imag(n))),"<cdot><b-i>\")"];
00020               else
00021                      tmp=["(with \"mode\" \"math\" \"", num2str(imag(n)),"<cdot><b-i>\")"];
00022               endif
00023        endif
00024 endfunction