NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/49207



The following reply was made to PR kern/49207; it has been noted by GNATS.

From: Alan Barrett <apb%cequrux.com@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: kern/49207
Date: Wed, 1 Oct 2014 20:41:39 +0200

 On Sat, 27 Sep 2014, Christos Zoulas wrote:
 >Also each time I will look at 31536000, I'd be tempted to divide
 >by 365 to see if it is correct. It is not like the compiler will
 >sweat over computing these, and they are not human friendly. I will
 >leave the multiplications in.
 
 I'd use 86400 for seconds per day, and multiplication for seconds 
 per year.  Something like (86400 * 365) presents no overflow 
 problems: if int is 32 bits, then it all fits, but if int is only 
 16 bits then 86400 will be long, so the result will be long, again 
 with no overflow.
 
 --apb (Alan Barrett)
 


Home | Main Index | Thread Index | Old Index