delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/08/29/15:15:34

From: Endlisnis <s257m AT unb DOT ca>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Quattro Pro @ROUND equivalent...
Date: Sat, 29 Aug 1998 15:31:06 -0300
Organization: NBTel Internet
Lines: 19
Message-ID: <35E848EA.AAFEC09@unb.ca>
References: <3 DOT 0 DOT 5 DOT 16 DOT 19980828114710 DOT 22f73f32 AT mail DOT tir DOT com>
NNTP-Posting-Host: fctnts12c03.nbnet.nb.ca
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Thomas J. Hruska wrote:
> 
> Is there a C library function that is equivalent to Quattro Pro's rounding
> function (@ROUND)?  For those of you who don't know the syntax of the
> function, here it is:
> @ROUND(x, num)
	Make your own.  Warning, untested code:
float Round(float x, int num)
{
 x+=pow(10,num)*.5;
 return ((int)(x/pow(10,num)))*pow(10,num);
 }
-- 
     (\/) Endlisnis (\/)
          s257m AT unb DOT ca
          Endlisnis AT GeoCities DOT com
          Endlis AT nbnet DOT nb DOT ca


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019