3 /* Unlike round() from libmath, this function rounds up to the highest
4 * integral value, so round(-1.5)=-1 rather than -2.
5 * This function tends to be called with positive values, in which case
6 * the behaviour is the same: round(1.5)=2.
8 double round(double dVal
) {
9 double dF
= floor(dVal
);
10 double dC
= ceil(dVal
);
12 if(dVal
- dF
< dC
- dVal
)