Rounding float values
C / C++ / MFC
10
Posts
6
Posters
0
Views
1
Watching
-
ceil()
function?ceil( 3.4 + 0.5 ) = 3; ceil( 3.5 + 0.5 ) = 4;
-
Try: floor(x + 0.5)
- S 50 cups of coffee and you know it's on! A post a day, keeps the white coats away!
-
You have to use floor() and add 0.5 to the number you want to round.
Cédric Moonen Software developer
Charting control [v1.5] OpenGL game tutorial in C++ -
:doh: ..am sorry.. I was ment to say
floor
() function. Please youfloor
(). -
You have to use floor() and add 0.5 to the number you want to round.
Cédric Moonen Software developer
Charting control [v1.5] OpenGL game tutorial in C++