[NTLUG:Discuss] The wrong computation example from the newsgroup

Steve Baker sjbaker1 at airmail.net
Mon Mar 19 20:42:24 CST 2001


sysmail at glade.net wrote:
> 
> You know, an easy way to fix is to just add .5 before any cast to int...

Or better still, use the function 'rint()' - which does the job *properly*
on all systems that support it.

-- 
Steve Baker   HomeEmail: <sjbaker1 at airmail.net>
              WorkEmail: <sjbaker at link.com>
              HomePage : http://web2.airmail.net/sjbaker1
              Projects : http://plib.sourceforge.net
                         http://tuxaqfh.sourceforge.net
                         http://tuxkart.sourceforge.net
                         http://prettypoly.sourceforge.net
                         http://freeglut.sourceforge.net



More information about the Discuss mailing list