home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / unix / programm / 4026 < prev    next >
Encoding:
Internet Message Format  |  1992-07-20  |  1.1 KB

  1. Xref: sparky comp.unix.programmer:4026 comp.unix.questions:9606
  2. Path: sparky!uunet!auspex-gw!guy
  3. From: guy@Auspex.COM (Guy Harris)
  4. Newsgroups: comp.unix.programmer,comp.unix.questions
  5. Subject: Re: Need (today's date - 2 WORKING days) [was: Need (today's date + [1-7]]
  6. Message-ID: <13837@auspex-gw.auspex.com>
  7. Date: 30 Jul 92 21:38:23 GMT
  8. References: <1992Jul28.072025.13886@cssc-syd.tansu.com.au> <1992Jul29.031546.26997@bnd2.bnd.oz.au> <Bs7E0r.Gpq@cck.coventry.ac.uk>
  9. Sender: news@auspex-gw.auspex.com
  10. Followup-To: comp.unix.programmer
  11. Organization: Auspex Systems, Santa Clara
  12. Lines: 16
  13. Nntp-Posting-Host: bootme.auspex.com
  14.  
  15. >>>        #define ONE_DAY    ((60) * (60) * (24))
  16. >
  17. >Call me stupid, but I thought the number of seconds in a day was constant.
  18. >
  19. >    #define ONE_DAY 86400
  20.  
  21. Yes, it *is* a constant, but one might want to have the C compiler
  22. calculate the value of that constant, rather than calculating it oneself
  23. and
  24.  
  25.     #define ONE_DAY    ((60) * (60) * (24))
  26.  
  27. is a fine way of doing that.
  28.  
  29. If the compiler doesn't calculate that at compile time, but generates
  30. code to do the multiplication at run time, then *it's* stupid.
  31.