Re: [U-Boot] [PATCH] improved strmhz()

2008-10-22 Thread Stefan Roese
Hi Wolfgang, On Tuesday 21 October 2008, Wolfgang Denk wrote: > > > --- a/lib_generic/strmhz.c > > > +++ b/lib_generic/strmhz.c > > > @@ -27,7 +27,7 @@ char *strmhz (char *buf, long hz) > > > long l, n; > > > long m; > > > > > > - n = DIV_ROUND(hz, 100L); > > > + n = DIV_ROUND(hz, 1000) /

Re: [U-Boot] [PATCH] improved strmhz()

2008-10-21 Thread Wolfgang Denk
Dear Kumar Gala, In message <[EMAIL PROTECTED]> you wrote: > > > --- a/lib_generic/strmhz.c > > +++ b/lib_generic/strmhz.c > > @@ -27,7 +27,7 @@ char *strmhz (char *buf, long hz) > > long l, n; > > long m; > > > > - n = DIV_ROUND(hz, 100L); > > + n = DIV_ROUND(hz, 1000) / 1000L; >

Re: [U-Boot] [PATCH] improved strmhz()

2008-10-21 Thread Mike Frysinger
On Tuesday 21 October 2008, Kumar Gala wrote: > I haven't been following this thread, but can we control the number of > significant digits. customizable # of digits is always going to differ according to taste. just lock everyone to like .3 and be done. no point in wasting overhead on this. -m

Re: [U-Boot] [PATCH] improved strmhz()

2008-10-21 Thread Jerry Van Baren
Kumar Gala wrote: >> That looks overly complex to me. Can you please check if this patch >> fixes the problem for your test cases, too: >> >>> From 963e7db81379225b78bfac0d7457300c86d6b4d6 Mon Sep 17 00:00:00 >>> 2001 >> From: Wolfgang Denk <[EMAIL PROTECTED]> >> Date: Tue, 21 Oct 2008 15:53:51 +

Re: [U-Boot] [PATCH] improved strmhz()

2008-10-21 Thread Kumar Gala
>> > That looks overly complex to me. Can you please check if this patch > fixes the problem for your test cases, too: > >> From 963e7db81379225b78bfac0d7457300c86d6b4d6 Mon Sep 17 00:00:00 >> 2001 > From: Wolfgang Denk <[EMAIL PROTECTED]> > Date: Tue, 21 Oct 2008 15:53:51 +0200 > Subject: [PATCH

Re: [U-Boot] [PATCH] improved strmhz()

2008-10-21 Thread Ilko Iliev
Wolfgang Denk wrote: > Dear Ilko Iliev, > > In message <[EMAIL PROTECTED]> you wrote: > >> This patch prevents the displaying of results like this: >> hz = 199917 >> buf = "200.-83" >> > > I think you got one '0' too many in your example - the example would > just print "1999.170" which

Re: [U-Boot] [PATCH] improved strmhz()

2008-10-21 Thread Wolfgang Denk
Dear Ilko Iliev, In message <[EMAIL PROTECTED]> you wrote: > This patch prevents the displaying of results like this: > hz = 199917 > buf = "200.-83" I think you got one '0' too many in your example - the example would just print "1999.170" which is correct. > --- a/lib_generic/strmhz.c > ++

[U-Boot] [PATCH] improved strmhz()

2008-10-21 Thread Ilko Iliev
This patch prevents the displaying of results like this: hz = 199917 buf = "200.-83" Signed-off-by: Ilko Iliev <[EMAIL PROTECTED]> index 342cf2b..981a75a 100644 --- a/lib_generic/strmhz.c +++ b/lib_generic/strmhz.c @@ -28,10 +28,15 @@ char *strmhz (char *buf, long hz) long m;