// Efficient frac = x - (x|0); // Might be more precise for large numbers. frac = x >= 0 ? x - floor(x) : x - floor(x) - 1;