[LCP]Rounding questions

Vincent Penquerc'h Vincent.Penquerch at artworks.co.uk
Thu Sep 5 20:11:06 UTC 2002


> Why is it rounding 390.0 and getting 2.896811?

Dunno. Try

double round(double x)
{
  return floor(x+0.5);
}

-- 
Vincent Penquerc'h 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.linux.org.au/pipermail/linuxcprogramming/attachments/20020905/1d8035db/attachment.htm 


More information about the linuxCprogramming mailing list