modified fp2bin and bin2fp using BitArray