home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS - Coast to Coast
/
simteldosarchivecoasttocoast2.iso
/
calculat
/
sm30a.zip
/
SYMBMATH.H44
< prev
next >
Wrap
Text File
|
1993-11-07
|
1KB
|
56 lines
4.12 Conversion
Different types of data may be converted each other.
4.12.1. Converting to Numbers
The complex number is converted to the real number by
re(z), im(z), abs(z), arg(z), sign(z)
The real number is converted to the interger number by
tranc(x)
round(x)
The real number is converted to the rational number by
ratio(x)
The rational number is converted to the real number by
num(x)
numeric:=on
The rational number is converted to the integer number by
nume(x)
deno(x)
The string is converted to the real number if possible, by
number("123")
4.12.2 Converting to lists
You can convert sum to a list of terms by
term(a+b)
IN: term(a+b)
OUT: [a, b]
You can convert product to a lsit of multiphiers by
mult(a*b)
IN: mult(a*b)
OUT: [a, b]
You can convert an array x to a list by
[ list(x[j], j,1,jmax,1) ]
4.12.3 Converting to strings
You can convert numbers to strings by
string(123)
IN: string(123)
OUT: "123"
4.12.4 Converting to Table
A list of real numbers can be converted to a table by
table()
Example 4.12.1.
IN: x := [5,4,3,2,1]
IN: table(x[j], j from 1 to 4 step 1)
OUT:
1, 5
2, 4
3, 3
4, 2