Skip to main content
Ivin Holmes
Associate
February 28, 2020
Question

I need to develop application using round function. The current math.h doesn't seem to support this function. Can anyone help

..

This topic has been closed for replies.

2 replies

PMath.4
Senior III
February 29, 2020
int round(double number)
{
 return (number >= 0) ? (int)(number + 0.5) : (int)(number - 0.5);
}

Ivin Holmes
Associate
February 29, 2020
Thanks