home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / sys / amiga / programm / 17860 < prev    next >
Encoding:
Text File  |  1992-12-28  |  828 b   |  27 lines

  1. Path: sparky!uunet!noc.near.net!hri.com!spool.mu.edu!olivea!charnel!rat!ucselx!crash!orbit!pnet51!chucks
  2. From: chucks@pnet51.orb.mn.org (Erik Funkenbusch)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: Stupid C question
  5. Message-ID: <8822@orbit.cts.com>
  6. Date: 28 Dec 92 08:25:02 GMT
  7. Sender: news@orbit.cts.com
  8. Organization: People-Net [pnet51], Minneapolis, MN.
  9. Lines: 16
  10.  
  11. ad99s461@sycom.mi.org (Alex Deburie) writes:
  12. >However, I have one very stupid (simple?) question. HOW DOES ONE COVERT A 
  13. >FLOATING POINT VALUE TO AN INTEGER???!!!  I see functions like modf(), but 
  14. >still that returns the integral part of the number as a float. And casting 
  15. >seems to always return a 0!
  16.  
  17.  
  18. funny... this return 6 when i run it.
  19.  
  20. void main(void) {
  21.  
  22.     printf ("%i\n", (int) 6.123);
  23.  
  24. }
  25.  
  26. I don't know why casting would return 0 for you..
  27.