Re: approximating division by a million Re: Why not POSIX time_t?

2002-07-16 Thread Brian Pane
Bill Stoddard wrote: Work up a patch to the apr_time macros and I'll benchmark it. This should be an easy and non intrusive thing to do. I tried to create a patch yesterday, but no luck. Given the wide range of values over which the macro has to work, I couldn't come up with with a macro that was

RE: approximating division by a million Re: Why not POSIX time_t?

2002-07-16 Thread Bill Stoddard
ject: approximating division by a million Re: Why not POSIX time_t? > > > Building upon Cliff's formulas, here's another idea > for doing faster conversions of the current apr_time_t > format to seconds: > > What we want is t/100 > > What we can do easily i

Re: approximating division by a million Re: Why not POSIX time_t?

2002-07-16 Thread Brian Pane
Ben Laurie wrote: Brian Pane wrote: Building upon Cliff's formulas, here's another idea for doing faster conversions of the current apr_time_t format to seconds: What we want is t/100 What we can do easily is t/1048576 But what can we add to t/1048576 to approximate t/100? If I solve for 'C

Re: approximating division by a million Re: Why not POSIX time_t?

2002-07-16 Thread Ben Laurie
Brian Pane wrote: Building upon Cliff's formulas, here's another idea for doing faster conversions of the current apr_time_t format to seconds: What we want is t/100 What we can do easily is t/1048576 But what can we add to t/1048576 to approximate t/100? If I solve for 'C' in t/100 =

approximating division by a million Re: Why not POSIX time_t?

2002-07-15 Thread Brian Pane
Building upon Cliff's formulas, here's another idea for doing faster conversions of the current apr_time_t format to seconds: What we want is t/100 What we can do easily is t/1048576 But what can we add to t/1048576 to approximate t/100? If I solve for 'C' in t/100 = t/1048576 + t/C I

Re: approximating division by a million Re: Why not POSIX time_t?

2002-07-15 Thread Brian Pane
Cliff Woolley wrote: On Mon, 15 Jul 2002, Brian Pane wrote: seconds = (t >> 20) + (t >> 24) That probably isn't accurate enough, but you get the basic idea: sum a couple of t/(2^n) terms to approximate t/100. What do you think? Sounds like the right idea. But I'm still not sure this i

Re: approximating division by a million Re: Why not POSIX time_t?

2002-07-15 Thread Cliff Woolley
On Mon, 15 Jul 2002, Brian Pane wrote: > seconds = (t >> 20) + (t >> 24) > > That probably isn't accurate enough, but you get the basic idea: > sum a couple of t/(2^n) terms to approximate t/100. > > What do you think? Sounds like the right idea. But I'm still not sure this isn't too compli