class ALU {

	public String floatMultiplication (String operand1, String operand2, int eLength, int sLength) {
		char sign = charOp(booleanXOR,operand1.charAt(0), operand2.charAt(0));
		
		if (operand1.substring(1).indexOf("1")==-1 || operand2.substring(1).indexOf("1")==-1){
			return "0"+sign+ALU.repeatedString("0", sLength+eLength);
		}
		
		
		int order1 = Integer.parseInt(integerTrueValue('0'+operand1.substring(1,eLength+1)));
		int order2 = Integer.parseInt(integerTrueValue('0'+operand2.substring(1,eLength+1)));
		long shift = (long) (Math.pow(2, eLength-1)-1); 
		
		

		long orderResult = order1+order2-shift;

		String manttisa1 = "01"+operand1.substring(eLength+1);
		String manttisa2 = "01"+operand2.substring(eLength+1);
		
		if (order1==0){
			manttisa1 = "00"+operand1.substring(eLength+1);
		}
		if (order2==0){
			manttisa2 = "00"+operand1.substring(eLength+1);
		}
		
		String manttisaResult = integerMultiplication(manttisa1, manttisa2, 2*sLength+2);
		manttisaResult = manttisaResult.substring(0, 3)+"."+manttisaResult.substring(3);
		if (manttisaResult.charAt(1)=='1'){
			manttisaResult = movePoint(manttisaResult, -1);
			orderResult++;
		}
		while (manttisaResult.charAt(manttisaResult.indexOf('.')-1)!='1'){
			manttisaResult = movePoint(manttisaResult, 1);
			orderResult--;
			if (orderResult==0){
				return "0"+sign+repeatedString("0", eLength)+manttisaResult.split("\\.")[1];
			}
		}
		if (orderResult > Math.pow(2, eLength)-1){
			return "1"+sign+repeatedString("1", eLength)+repeatedString("0", sLength);
		}
		
		StringBuilder result = new StringBuilder();
		result.append('0');
		result.append(sign);
		result.append(integerRepresentation(String.valueOf(orderResult), eLength));
		result.append(manttisaResult.split("\\.")[1].substring(0,sLength));
		
		return result.toString();
	}

}