home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS - Coast to Coast / simteldosarchivecoasttocoast2.iso / calculat / sm30a.zip / SYMBMATH.H44 < prev    next >
Text File  |  1993-11-07  |  1KB  |  56 lines

  1.         4.12   Conversion 
  2.     Different types of data may be converted each other.
  3.     
  4.         4.12.1.  Converting to Numbers
  5.     The complex number is converted to the real number by
  6.         re(z), im(z), abs(z), arg(z), sign(z)
  7.     The real number is converted to the interger number by
  8.         tranc(x)
  9.                 round(x)
  10.     The real number is converted to the rational number by
  11.         ratio(x)
  12.     The rational number is converted to the real number by
  13.         num(x)
  14.                 numeric:=on
  15.     The rational number is converted to the integer number by
  16.                 nume(x)
  17.                 deno(x)     
  18.     The string is converted to the real number if possible, by
  19.                 number("123")
  20.  
  21.                 4.12.2  Converting to lists
  22.         You can convert sum to a list of terms by
  23.                         term(a+b)
  24.  
  25. IN:  term(a+b)
  26. OUT: [a, b]
  27.  
  28.         You can convert product to a lsit of multiphiers by
  29.                         mult(a*b)
  30.  
  31. IN:  mult(a*b)
  32. OUT: [a, b]
  33.  
  34.        You can convert an array x to a list by
  35.                 [ list(x[j], j,1,jmax,1) ]
  36.  
  37.                 4.12.3  Converting to strings
  38.         You can convert numbers to strings by
  39.                         string(123)
  40. IN:  string(123)
  41. OUT: "123"
  42.  
  43.         4.12.4  Converting to Table
  44.     A list of real numbers can be converted to a table by
  45.         table()
  46.     
  47.     Example 4.12.1.
  48.  
  49. IN:  x := [5,4,3,2,1]
  50. IN:  table(x[j], j from 1 to 4 step 1)
  51. OUT:
  52. 1,      5
  53. 2,      4
  54. 3,      3
  55. 4,      2
  56.