From: Derek Greene Newsgroups: comp.os.msdos.djgpp Subject: Re: Round function? Date: Thu, 29 Oct 1998 13:40:31 -0500 Organization: MindSpring Enterprises Lines: 17 Message-ID: <3638B69E.DFB4EF4F@mindspring.com> References: NNTP-Posting-Host: user-37kboqj.dialup.mindspring.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Server-Date: 29 Oct 1998 18:36:49 GMT X-Mailer: Mozilla 4.5 [en] (Win95; I) X-Accept-Language: en To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Thank you Mr. Zaretskii. Derek Greene Eli Zaretskii wrote: > On Wed, 28 Oct 1998, Derek Greene wrote: > > > Is there a functionf or rounding off real numbers when casting to > > integers or will a normal type cast do the trick? TIA > > DJGPP has a function called `rint' which rounds a number. You need to > link with -lm to get it, since it's in libm.a which by default isn't > scanned by the linker. > > Most Unix compiler also support `rint' although it isn't ANSI.