/ Published in: C++
Expand |
Embed | Plain Text
#include "math.h" #define round(x) (x<0?ceil((x)-0.5):floor((x)+0.5)) //or #define round(x) ((x)>=0?(long)((x)+0.5):(long)((x)-0.5))
You need to login to post a comment.
yuconner on 08/03/06
2 people have marked this snippet as a favorite
#include "math.h" #define round(x) (x<0?ceil((x)-0.5):floor((x)+0.5)) //or #define round(x) ((x)>=0?(long)((x)+0.5):(long)((x)-0.5))
You need to login to post a comment.