question about conditional operator (?:)

Adam D. Ruppe via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Jul 26 06:17:27 PDT 2016


On Tuesday, 26 July 2016 at 13:09:28 UTC, Richard wrote:
>         n%p==0 ? n/=p : p+=1 ;


Try

(n%p==0) ? n/=p : p+=1 ;


I'm pretty sure the order of operations (precedence rules) puts 
?: above ==.


More information about the Digitalmars-d-learn mailing list