There's a command in Math.h in C to round-up numbers. What's the name of that command? For example of Rounding-up numbers is.
Round up 5.5 which is, 6 is the answer.
Thanks in advance.
This is a discussion on Math.h Help within the C Programming forums, part of the General Programming Boards category; There's a command in Math.h in C to round-up numbers. What's the name of that command? For example of Rounding-up ...
There's a command in Math.h in C to round-up numbers. What's the name of that command? For example of Rounding-up numbers is.
Round up 5.5 which is, 6 is the answer.
Thanks in advance.
There's different ceiling functions, depending on what you want to do:
double ceil(double x);
float ceil(float x); [C++ only]
long double ceil(long double x); [C++ only]
float ceilf(float x); [required with C99]
long double ceill(long double x); [required with C99]
-Govtcheez
govtcheez03@hotmail.com
Code:#include<iostream> float Round(float number) { float f_temp = number * 10.0; int i_decimal = (int) f_temp % 10; if( i_decimal >= 5) { i_decimal = (int) number +1; }else { i_decimal = (int) number; } return i_decimal; } int main() { std::cout << Round(7.5); return 0; }
I compile code with:
Visual Studio.NET beta2