delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/10/17/10:46:40

From: Darren Grant <darn AT merlin DOT imag DOT net>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: simple thing
Date: Thu, 16 Oct 1997 21:41:57 -0700
Organization: Vancouver Classic Video Games Club, http://www.vcvgc.bc.ca/
Lines: 9
Message-ID: <3446EC95.6229@vxl.imag.net>
References: <34455CCF DOT 41C6 AT jcu DOT edu DOT au>
Reply-To: darn AT merlin DOT imag DOT net
NNTP-Posting-Host: turkey.imag.net
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Oon Lin wrote:
> 
>   printf("Vertical Retrace Time = %f \n", 1/70) ;


"1" and "70" are both implicitly declared as ints above.  It's just the
way C works.  You can get around this by explicitly casting the values
as floats or doubles (recommended), or trailing the whole numbers with
decimal points (e.g. "1." and "70." or even "1.0" and "70.0").

- Raw text -


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