y63308042 2010-08-23 02:16:00
点我顶贴
收藏
删除
type 高精度类型
二维高精度数组类型
//有效符号指存在于括号外的符号
function calc (式子:string):二维高精度数组
{
if 没有运算符 then exit( 转换( 式子 -> 数组 ) )
if 式子两端有一对括号(相对应的,一左一右) then 删除两端括号
if pos('+''-') then
if 存在有效+-号 then
{
tmp=右边第一个有效+-号
exit( 矩阵加减( calc(左串) , calc(右串) ) )
}
if pos('*''/') then
if 存在有效*/号 then
{
tmp=右边第一个有效*/号
exit( 矩阵乘除( calc(左串) , calc(右串) ) )
}
if pos('^') then
if 存在有效^号 then
{
tmp=右边第一个有效^号
exit( 矩阵乘方( calc(左串) , calc(右串) ) )
}
}