#include "header.h" long int n; int FloatToBin(float BaseTen) { int n; double y; if(BaseTen>=1 || BaseTen<=0) //checks to see that the number is between 0 and 1 return 0; for(n=0;n<32 && BaseTen!=0;n++) { BaseTen=2*BaseTen; //multiplies the number by 2 and if the digit in the 1's place is a 1, then a one is placed in the the vector storing the binary number y=floor(BaseTen); if(y>0) { BinVect[n]=1; BaseTen=BaseTen-1; } else //if it is not a 1, then a 0 is placed in the vector { BinVect[n]=0; } } return 1; }