On 23-3-2010 7:59, Trass3r wrote: >> I never knew exactly what the float-to-int C cast is supposed to do. >> >> float f = whatever(); >> int b = cast(int) f; >> >> >> Does it truncate, floor or round ? > > I've never heard anything else but truncate. Rounding can thus be done > with cast(int)(f + 0.5f). or -0.5f when f < 0.0