Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 Dec 1997 19:44:43 +1100
From:      Bruce Evans <bde@zeta.org.au>
To:        jmb@FreeBSD.ORG, lars@fredriks-1.pr.mcs.net
Cc:        current@FreeBSD.ORG
Subject:   Re: EDOM and hz
Message-ID:  <199712190844.TAA04332@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>> Rich Stevens recommends:
>> 
>> 	if (tv->tv_sec*hz + tv_usec/tick > SHRT_MAX) {
>> 		error = EDOM;
>> 		goto bad;
>> 	}
>> 
>> 
>> 	where tick = 1,000,000 / hz
>> 	and   SHRT_MAX = 32767
>> jmb
>> 
>
>Looks like a winner to me! Anyone care to commit - or I can. Just
>say the word..

Don't.  Sorry I missed your main point that the current code cannot
work for hz > sqrt(SHRT_MAX).  Correct code only cannot work for
hz > SHRT_MAX (approx.) :-).

Bruce



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199712190844.TAA04332>