From: Erik Max Francis Newsgroups: comp.os.msdos.djgpp Subject: Re: how to convert float ->int? Date: Fri, 06 Jun 1997 02:50:45 -0700 Organization: Alcyone Systems Lines: 25 Message-ID: <3397DD75.57714DFC@alcyone.com> References: <199705311842 DOT LAA03805 AT geocities DOT com> NNTP-Posting-Host: newton.alcyone.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Guilherme Silveira wrote: > There's the way to convert from float to int: > > Function FCVT (propabily Float Converter) ... Bizarre. First, this doesn't answer the question. fcvt would convert a double to a _string_, not an int. Last I heard, "string" and "int" don't mean the same thing. Second, fcvt is Borland-specific and not ANSI C. As such, it's not a very good suggested, even if it solved the problem the original poster was asking about. The correct (and trivially simple) thing to do is a typecast: float f = /* ... */; int i = (int) f; -- Erik Max Francis, &tSftDotIotE / email / max AT alcyone DOT com Alcyone Systems / web / http://www.alcyone.com/max/ San Jose, California, United States / icbm / 37 20 07 N 121 53 38 W \ "Covenants without the sword / are but words." / Camden