f = f - (float)((int)f);
とかじゃ駄目?