class ALU {

	public String floatTrueValue (String operand, int eLength, int sLength) {
		boolean isNegative = operand.charAt(0)=='1';
		boolean notStandardized = operand.matches(String.format("(1|0)(0{%d})[01]{%d}",eLength,sLength));
		//infinity
		if (floatIsInfinity(operand, eLength, sLength)){
			return (isNegative?"-":"+")+"Inf";
		}

		//NaN
		if (operand.matches(String.format("(1|0)(1{%d})[01]{%d}",eLength,sLength))){
			return "NaN";
		}

		int shift = (int)(Math.pow(2, eLength-1)-1);
		int exponentValue = -shift;
		double mantissaValue = 1;

		if (notStandardized){
			exponentValue = -shift+1;
			mantissaValue = 0;
		}

		String mantissa = operand.substring(eLength+1);

		for(int i=eLength;i>=1;i--){
			exponentValue+= Integer.parseInt(operand.substring(i,i+1)) * Math.pow(2, eLength-i);
		}

		for(int i=0;i<sLength;i++){
			mantissaValue+= Double.parseDouble(mantissa.substring(i,i+1)) * Math.pow(2, -i-1);
		}

		double result = mantissaValue * Math.pow(2, exponentValue);
		if (result == (int)result){
			return (isNegative?"-":"") + String.valueOf((int)result)+".0";
		}
	
		String resultRepresentation = String.valueOf(result);
		if (resultRepresentation.contains("E")){
			String[] split = resultRepresentation.split("E");
			resultRepresentation = movePoint(split[0], Integer.parseInt(split[1]));
		}

		return (isNegative?"-":"") + resultRepresentation;
		


	}

}