Esempio n. 1
0
    void multiply(ComplexByte cparm)
    {
        int rtemp, itemp;

        rtemp = (real * cparm.getrealpart( ) - imag * cparm.getimagpart( ));
        itemp = (real * cparm.getimagpart( ) + cparm.getrealpart( ) * imag);

        if ((rtemp > 127) || (rtemp < -128))
        {
            throw new ArithmeticException();
        }
        if ((itemp > 127) || (itemp < -128))
        {
            throw new ArithmeticException();
        }
        real = (byte)rtemp;
        imag = (byte)itemp;
    }
Esempio n. 2
0
 int equals(ComplexByte cparm)
 {
     if (real != cparm.getrealpart())
     {
         return(0);
     }
     if (imag != cparm.getimagpart( ))
     {
         return(0);
     }
     return(1);
 }
Esempio n. 3
0
	int equals( ComplexByte cparm )
	{
		if (real != cparm.getrealpart())
		{
			return 0;
		}
		if(imag != cparm.getimagpart( ))
		{
			return 0;
		}
		return 1;
	}
Esempio n. 4
0
    void add(ComplexByte cparm)
    {
        int rtemp, itemp;

        rtemp = real + cparm.getrealpart();
        if ((rtemp > 127) || (rtemp < -128))
        {
            throw new ArithmeticException();
        }
        itemp = imag + cparm.getimagpart();
        if ((itemp > 127) || (itemp < -128))
        {
            throw new ArithmeticException();
        }
        real = (byte)(rtemp);
        imag = (byte)(itemp);
    }
Esempio n. 5
0
 void assign(ComplexByte cparm)
 {
     real = cparm.getrealpart( );
     imag = cparm.getimagpart( );
 }
Esempio n. 6
0
 public ComplexByte(ComplexByte cparm)
 {
     this.real = cparm.getrealpart( );
     this.imag = cparm.getimagpart( );
 }
Esempio n. 7
0
	void add( ComplexByte cparm ) 
	{
		int rtemp, itemp;
		rtemp = real + cparm.getrealpart();
		if ( ( rtemp > 127 ) || ( rtemp < -128 ) )
			throw new ArithmeticException();
		itemp = imag + cparm.getimagpart();
		if ( ( itemp > 127 ) || ( itemp < -128 ) )
			throw new ArithmeticException();	
		real = (byte)( rtemp);
		imag = (byte)( itemp );
	}
Esempio n. 8
0
	void assign( ComplexByte cparm )
	{
		real = cparm.getrealpart( );
		imag = cparm.getimagpart( );
	}
Esempio n. 9
0
	public ComplexByte( ComplexByte cparm )
	{
		this.real = cparm.getrealpart( );
		this.imag = cparm.getimagpart( );
	}
Esempio n. 10
0
	void multiply( ComplexByte cparm )  
	{
		int rtemp, itemp;
	
		rtemp = (real * cparm.getrealpart( ) - imag * cparm.getimagpart( ));
		itemp = (real * cparm.getimagpart( ) + cparm.getrealpart( ) * imag);

		if ( ( rtemp > 127 ) || ( rtemp < -128 ) )
			throw new ArithmeticException();
		if ( ( itemp > 127 ) || ( itemp < -128 ) )
			throw new ArithmeticException();	
		real = (byte) rtemp;
		imag = (byte) itemp;
	}