<awangdev>Fraction to Recurring Decimal_1.java
public String fractionToDecimal(int numerator, int denominator) {
        long nume = Math.abs((long)numerator);
        long deno = Math.abs((long)denominator);
        String sign = (numerator < 0) ^ (denominator < 0) ? "-" : "";
        if (deno == 0) {
        	return "";
        } else if (nume == 0) {
        	return "0";
        } else if (nume % deno == 0) {
        	return sign + nume/deno + "";
        }
        
        HashMap<Long,Integer> map = new HashMap<Long, Integer>();
        StringBuffer rst = new StringBuffer(sign + nume/deno + ".");
        long end = nume%deno * 10;
  		int i = 0;
        while (end != 0){
			if (map.containsKey(end)) {
				rst.insert(rst.indexOf(".") + map.get(end) + 1, "(");
				rst.append(")");
				return rst.toString();
			}
			rst.append(end/deno);
        	map.put(end, i++);
        	end = (end % deno) * 10;
        }
        return rst.toString();
    }
public String var_0 ( int var_1 , int var_2 ) {
  long var_5 = Math . abs ( ( long ) var_1 ) ;
  long var_6 = Math . abs ( ( long ) var_2 ) ;
  String var_11 = ( var_1 < 0 ) ^ ( var_2 < 0 ) ? "-" : "" ;
  if ( var_6 == 0 ) {
    return "" ;
  }
  else if ( var_5 == 0 ) {
    return "0" ;
  }
  else if ( var_5 % var_6 == 0 ) {
    return var_11 + var_5 / var_6 + "" ;
  }
  HashMap < Long , Integer > var_16 = new HashMap < Long , Integer > ( ) ;
  StringBuffer var_19 = new StringBuffer ( var_11 + var_5 / var_6 + "." ) ;
  long var_21 = var_5 % var_6 * 10 ;
  int var_22 = 0 ;
  while ( var_21 != 0 ) {
    if ( var_16 . containsKey ( var_21 ) ) {
      var_19 . insert ( var_19 . indexOf ( "." ) + var_16 . get ( var_21 ) + 1 , "(" ) ;
      var_19 . append ( ")" ) ;
      return var_19 . toString ( ) ;
    }
    var_19 . append ( var_21 / var_6 ) ;
    var_16 . put ( var_21 , var_22 ++ ) ;
    var_21 = ( var_21 % var_6 ) * 10 ;
  }
  return var_19 . toString ( ) ;
}
