Math: Check if input is a factor of target Integer

If the B is also an integer, then try this:

If (B % A == 0)
{
   //Do the thing
}

else you can try the fmod function from math.h