Exp=-
@p1=
@c1=result =  CalculateEx_2(DecArray,temp_a, temp_b, c, d,KeyPath,16, 2000)
@p2=
@c2=result =  CalculateEx_2(DecArray,temp_a, temp_b, c, d,KeyPath,16, 2000)
@va=temp_a
@vb=temp_b
@vc=c
@vd=d
ext=
mgs=
@end
public function long ydivide (  long a, long b );
//YDivide:
//Ŀģ
//soft_enc_11:soft_enc_1ؼ
//int_str1:int_str1ؼ
//aҪı1
//bҪı2
//ؽ˺Ľ
//LastError=0ȷLastErrorΪμֲ
    Boolean b_reverse  //ֲڴ淴ת
	Integer temp,temp_b
        
	char  InArray[16]
	char  DecArray []
    int n
	//칤ɵļܺļܱʽ
	//бܵıʽΪ@exp
	InArray[1]=char(@ak100);InArray[2]=char(@ak101);InArray[3]=char(@ak102); InArray[4]=char(@ak103);
	InArray[5]=char(@ak104);InArray[6]=char(@ak105);InArray[7]=char(@ak106); InArray[8]=char(@ak107);
	InArray[9]=char(@ak108);InArray[10]=char(@ak109);InArray[11]=char(@ak110);InArray[12]=char(@ak111);
	InArray[13]=char(@ak112);InArray[14]=char(@ak113);InArray[15]=char(@ak114);InArray[16]=char(@ak115);
	//ܺıʽ͵ннܲ¼ܣʹӦȨţעת
	//Ȼ󷵻ؼܺݣüܺüӦ
	//ֻбӦȨŽתݲܱӦļܲ
	for n=1 to 16
			DecArray[n]=char(0)
	next 
	LastError=E_Dec_6(E_HKey, E_LKey, InArray, DecArray, KeyPath)
	if  LastError<> 0 then
	  return 0
	end if
///////////////////////////////////////////////////////////////////////////////////////      
    
    //a,bΪΪ
    If ((a > 0 And b > 0) Or (a < 0 And b < 0)) Then
        //Ϊ
        a = Abs(a)
		  b = Abs(b)
        //ļȻͿʹDecreaseһʹˡa/bΪ(a+b)/b-1
        a = (a + b) / b
		  b = 1
		temp_b=1//bֵtemp_b
        //ֲ
        Integer temp_a 
        //a256ȡ
        //ΪʲôҪab256ȡأ
        //ΪCal_2ʽֻֽڱܳ256
        temp_a = (a - (a / 256) * 256)
        //aȥ//bȥ
        //ΪʲôҪֱa,bȥأ
        //Ϊ׼ڼڲμ㣬a,bҪֱȥԼ
        a = a - temp_a
        Integer result  //ֲ,ؽ
        Integer c 
        Integer d 
	c = rand(256)-1
	 d = rand(256)-1
        //жtemp_abĴС
        //temp_abCal_2ĵһΪtemp_a
        //temp_aСbCal_2ĵһΪ_b
        //ΪʲôҪأΪڲֻa>bļa<bѭ޷ʹ÷ص
        If (temp_a > b) Then
            //ⲽa,bĸ͵ڲ,
            //@fļе@pλдмʽ
            @1
            //ͬʱδת
            b_reverse = True
        Else
            //ⲽa,bĸ͵ڲ,
            //@fļе@pλдмʽ
	
	temp=temp_b
	temp_b=temp_a
	temp_a=temp
            @1
        //ͬʱѷת
            b_reverse = False
        End If
        If (result <> 0) Then LastError = result //ô
        //ڼĽصtemp_a
        //ٽǰȥa,bͿˡ
        //ݷתòͬ
        If (b_reverse) Then
            If (a + temp_a < 0) Then 
					return  0 //Ϊ
				end if
            return a + temp_a //δתa,bΪֱtemp_a
        Else
            If (a - temp_a < 0) Then
					return 0 //Ϊ
				end if
           return a - temp_a //ѷתa,bΪ,ȥtemp_b
        End If
	end if
    return a / b

end function
