How do I convert a floating point number to an integer, at the same time rounding up the number? not truncating it, but rounding it up...
i forgot the function for it...
This is a discussion on Conversion of floating-point number within the C Programming forums, part of the General Programming Boards category; How do I convert a floating point number to an integer, at the same time rounding up the number? not ...
How do I convert a floating point number to an integer, at the same time rounding up the number? not truncating it, but rounding it up...
i forgot the function for it...
Only by the cross are you saved...
>How do I convert a floating point number to an integer, at the same time rounding up the number?
double d = 1.7;
int i = (int)(d + .5);
My best code is written with the delete key.