Re: G_MICROSEC



On Wed, 6 Sep 2000, Sebastian Wilhelmi wrote:

> Hi Owen,
> 
> While trying to get rid of G_MICROSEC I'll noticed the following:
> 
> > After all, I think 1e6 is a valid integer constant in C. (gcc accepts it
> > anyways.)
> 
> It isn't an integer constant, but a float one (I checked it in K&R). You
> mostly do not notice though, because gcc will optimize it, but try 
> "a = b % 1e6". That won't work.
> 
> Two options:
> 
> 1) Let the user use 1e6 hoping that the compiler will get things right. The
>    user will most certainly not need '%'.
> 2) Define G_MICROSECS_PER_SEC or G_MICRO or maybe even G_MEGA to be 100000.

heck, couldn't we just put:

/* microseconds per second, convenience macro: */
#define G_MICROSECS 1000000

picking something twice as long as 1000000 really makes
matters inconvenient.

> 
> Bye,
> Sebastian

---
ciaoTJ





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]