lkml.org 
[lkml]   [2014]   [Jun]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 6/7] cpufreq: intel_pstate: Trivial code cleanup
From
Date
On Tue, 2014-06-10 at 23:38 +0200, Rafael J. Wysocki wrote:

> > > is. And the result of (a * 100) / b may generally be different from
> > > a * 100 / b for integers (if the division is carried out first).
> >
> > I thought that (a * 100) / b is always equivalent to a * 100 / b.
>
> I'm not actually sure if that's guaranteed by C standards.

It is. left to right, same precedence.

> It surely
> wasn't some time ago (when there was no formal C standard).

c89 is 25 years ago now.

> Either way, in my opinion it's better to put the parens into the expression
> in this particular case to clearly state the intention.

I don't think so.




\
 
 \ /
  Last update: 2014-06-10 23:41    [W:0.068 / U:0.204 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site