Converting a number to binary and back as a test in Java This is one of my first takes on Java, coming mainly from Matlab I found I had many things to learn.
The code will try to convert a number into an array of ones and zeros and then do the opposite returning you the original number (or at least something very close to it, as it is hard to return the exact number). It is not tested very well, so I can only tell that it is symmetric and not that it is correct.  

It would be nice to know any errors I have made, or things that I could improve. An idea I had was using BigInt, I have read about it but not yet used it. 

If you could focus on the language specific issues and kindly point them out I would be grateful.

package baseconversion;

import java.lang.Math;
import java.util.Arrays;

public class FloatToBin{

    public static double pow2(double a, double b) {
        return a * (java.lang.Math.pow(2, b));
    }

    public static double rem(double a, double b) {
        return a % b;
    }

    public static double fix(double val) {
        if (val &lt; 0) {
            return Math.ceil(val);
        }
        return Math.floor(val);
    }

    public static double vConv(int[] a, double[] b) {
        int aRows = a.length;
        int bRows = b.length;
        double c = 0;
        for (int i = 0; i &lt; aRows; i++) { 
                c += a[i] * b[i];
        }
        return c;
    }

    public static void main(String []args){
        double a = 340.3562; 
        int n = 20;   
        int m = 20;

        int count = 0;

        int[] out = new int[n + m];       

        for (int i = -(n-1); i &lt;= m; i++) {
             out[count] = (int)rem(a * pow2(1, (double)i), 2);
             count++;
        } 

        double[] temp = new double[n + m];
        double origVal;
        count--;
        int revCount = 0; 

        for (int ii = n - 1; ii &gt;= -m; ii--) {
             temp[revCount] = pow2(1, (double)ii);
             count--;
             revCount++;
        }

        origVal = vConv(out, temp);      

        System.out.println("Original number is:");
        System.out.println(a);
        System.out.println("Binary representation is:");
        System.out.println(Arrays.toString(out));
        System.out.println("Inverting we get:");
        System.out.println(origVal);
    }
}
Cryptic names

int n = 10;   
int m = 20;


Please give longer and more descriptive names to n and m

Overworked main

I would define outside of main

public static double FloatToBin(float n) {

}

public static double BinToFloat(bin n) {

}


So that main can contain the IO only.