|
|
вернуться в форумОбщий форумround, c++ Excuse me, I have next problem: I have got 'compilation error' twice because of using function round() from library 'cmath'. But it works normally in Code::Blocks on my PC. What is the problem and how can I substitute round function? Re: round, c++ а что именно в сообщении об ошибке выдаёт компилятор? Re: round, c++ 941ef0f3-e7a3-4f31-a9b3-5be1b580cf1b 941ef0f3-e7a3-4f31-a9b3-5be1b580cf1b(48) : error C3861: 'round': identifier not found Re: round, c++ > how can I substitute round function? I'm not sure about all these tricks, but this may work: > double d; > int x = (int)(d+0.5); For me round worked just fine, but last time I had used it before compiler was changed. Btw, what compiler do you use in code::blocks? GCC? Re: round, c++ Use floor or ceil |
|
|