Skip to main content
Ivin Holmes
Associate
Feb 28, 2020 7:16 PM UTC
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
Feb 29, 2020 8:38 AM UTC
int round(double number)
{
 return (number >= 0) ? (int)(number + 0.5) : (int)(number - 0.5);
}

Ivin Holmes
Associate
Feb 29, 2020 12:54 PM UTC
Thanks