On Wed, Dec 19, 2012 at 7:37 AM, Poul-Henning Kamp <p...@phk.freebsd.dk>wrote:
> -------- > In message <20121219150809.ga98...@onelab2.iet.unipi.it>, Luigi Rizzo > writes: > > >> typedef dur_t int64_t; /* signed for bug catching */ > >> #define DURSEC ((dur_t)1 << 32) > >> #define DURMIN (DURSEC * 60) > >> #define DURMSEC (DURSEC / 1000) > >> #define DURUSEC (DURSEC / 10000000) > >> #define DURNSEC (DURSEC / 10000000000) > > >only thing, we must be careful with the parentheses > > Actually, it's more impportant to be careful with zeros, if you > adjust the above to the correct number of zeros, DURNSEC is 4, > which is within seven percent of the correct value. > counting digits is impossible for people over 45. But i have a solution for that #define DURNSEC (DURSEC / 1003006009) which is within 0.5% of the desired value. (and of course (1000*1000*1000) might do the job too) cheers luigi _______________________________________________ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"