Date: Fri, 6 Jun 1997 14:14:53 -0400 (EDT) From: "Art S. Kagel" To: Real Email in Sig! Cc: djgpp AT delorie DOT com Subject: Re: how to convert float ->int? In-Reply-To: <5n4gt3$avg@news.duq.edu> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk On 4 Jun 1997, Real Email in Sig! wrote: > POULAIN Vincent (vpoulain AT club-internet DOT fr) wrote: > : Only if you want the integer part of your float. > : If you want a rounded value, this will not work of course :-) > > How about a=(b+0.5); for a rounded answer? Seems right, but I've been > wrong on easier stuff before. a=(b+0.5005) is better to handle rounding of values not exactly representable in IEEE float formats. Art S. Kagel, kagel AT bloomberg DOT com