Date: Thu, 8 May 1997 22:10:02 -0400 (EDT) From: Michael Phelps To: mac martin cc: djgpp AT delorie DOT com Subject: Re: rounding double type In-Reply-To: <33715231.6FD7@12.us.jeffco> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk On Wed, 7 May 1997, mac martin wrote: > How do you round a double type number to the nearest whole number then > convert it to and int? > Simple: (int)(x + 0.5) ---Michael Phelps morphine AT cs DOT jhu DOT edu CH3 | N / | ______/ | / \ CH2 _____/ \__|__ // \\ / | \\ // \\______/___CH2 \\ \ / \ / \______/ \_____/ / ------ \ / \ OH \ / OH O Morphine