Mail Archives: djgpp/1997/06/06/12:47:27
POULAIN Vincent (vpoulain AT club-internet DOT fr) wrote:
: > whats the best way of converting from float to int?
: I do use a simple way :
: int a;
: float b=3.14;
: Fine, isn't it ?
: Only if you want the integer part of your float.
: If you want a rounded value, this will not work of course :-)
How about a=(b+0.5); for a rounded answer? Seems right, but I've been
wrong on easier stuff before.
E M A I L : substitute 'eNn' 'Oh' 'eSs' 'Pee' 'Aay' 'eMm'
with 'Kay' 'aRe' 'yoU' 'eSs' 'Tea' 'whY'
- Raw text -