1 2 3 4 5 6 7 8 9 10 11 12 13
#include <u.h> #include <base.h> double math·round(double x) { double f; f = math·floor(x); if((x-f) > 0.5) return f+1; return f; }