implement frac calculation on cpu
compile fix
fix some warnings