how to convert negative float number into binary vector in java : Can anyone please tell me how can I convert this float number: -2.25 to binary? 

I know how to convert the "2" but not the 0.25 nor the negative sign

this is my method and I stuck there I could not know how to enhance it to give me correct result when converting float, negative int or negative float number 

p

    ublic class MinimizeRastriginFunction {
    
        public static String binary="";
        
        /**
         * @param args the command line arguments
         */
        public static void main(String[] args) {
            // TODO code application logic here
            
            //float x=(float) 2.5;
            int x =5 ;
            System.out.println("Before :" + x);
            decToBin(x);
            System.out.println("After :"  + binary);
    
            
        }
        
        private static Object decToBin(int dec) {
    		// TODO Auto-generated method stub
    		int num;
     
            if (dec <=1) {
                binary +=dec;
                return null;   // KICK OUT OF THE RECURSION
            }
     
            num= dec %2; 
            decToBin(dec >>1);
            binary += num;
            return null;	
    	}
    