public String printBin(double num) {
StringBuffer sb=new StringBuffer("0.");
int count=32;
while(num!=0.0){
count--;
if(count<0)
return "Error";
num=num*2;
if(num>=1) {
sb.append("1");
num-=1;
}else sb.append("0");
}
return sb.toString();
}