<awangdev>Binary Representation_2.java
public String parseDecimal(String n) {
        if (n.length() == 0 || n.equals("0")) {
            return "";
        }
        double num = Double.parseDouble("0." + n);
        HashSet<Double> set = new HashSet<>();
        StringBuffer sb = new StringBuffer();
        while (num > 0) {
            if (sb.length() > 32 || set.contains(num)) {
                return "ERROR";
            }
            set.add(num);
            if (num * 2 >= 1) {
                sb.append("1");
                num = num * 2 - 1;
            } else {
                sb.append("0");
                num = num * 2;
            }
        }
        return sb.toString();
    }
public String var_0 ( String var_2 ) {
  if ( var_2 . length ( ) == 0 || var_2 . equals ( "0" ) ) {
    return "" ;
  }
  double var_11 = Double . parseDouble ( "0." + var_2 ) ;
  HashSet < Double > var_13 = new HashSet < > ( ) ;
  StringBuffer var_15 = new StringBuffer ( ) ;
  while ( var_11 > 0 ) {
    if ( var_15 . length ( ) > 32 || var_13 . contains ( var_11 ) ) {
      return "ERROR" ;
    }
    var_13 . add ( var_11 ) ;
    if ( var_11 * 2 >= 1 ) {
      var_15 . append ( "1" ) ;
      var_11 = var_11 * 2 - 1 ;
    }
    else {
      var_15 . append ( "0" ) ;
      var_11 = var_11 * 2 ;
    }
  }
  return var_15 . toString ( ) ;
}
