Re: Newbie question: it works, but what's it doing?

From: Zac Bond (zwb2_at_cwru.edu)
Date: 03/20/04

  • Next message: Mrpants: "Re: Newbie question: it works, but what's it doing?"
    Date: Fri, 19 Mar 2004 22:24:40 -0500
    
    

    "Dan Moos" <dan.moos@verizon.net> wrote in message
    news:hKM6c.1765$Ec6.1153@nwrddc02.gnilink.net...
    > > it does a 'mod' divide of (rand()+1) ( mod returns the remainder
    of an
    > > integer divide). as for the (3-1+1) i can never remember the
    precedence
    > > of this so i always use more '()' than i need to make sure -
    ((3-1)+1)
    > > or (3-(1+1)). as you can see it does make a difference!
    >
    > Am I missing something? Addition works the same no matter how you
    > paranthesise the statement
    >
    > (3-1+1) = (3-1)+1 = 3+(-1+1) = 3
    >
    > Is there something obvious I'm not seeing?

    3-(1+1), if you are only changing parentheses. That being said, I
    don't understand why the code uses "3-1+1" instead of just "3".

    -Zac


  • Next message: Mrpants: "Re: Newbie question: it works, but what's it doing?"

    Relevant Pages

    • Re: Newbie question: it works, but whats it doing?
      ... I borrowed the code from an example provided by my tutor, ... >> Am I missing something? ... Addition works the same no matter how you ... >> paranthesise the statement ...
      (alt.comp.lang.learn.c-cpp)
    • Re: C/C++ Ambiguity in Order of Evaluation
      ... It is I who is missing something! ... if I don't know any connection between precedence of ... operators and order of evaluation, does it matter? ...
      (comp.lang.c)
    • Re: LIGO.
      ... The missing link is there. ... The DM halo is always invoked _a posteriori_, when GR does not fit ... matter got a whole lot more substantial. ... not the missing planet the missing planet isn't there no more. ...
      (sci.physics.relativity)
    • Re: was (one more thing I want to show the public and court)
      ... No matter how long you do this, ... weakness that the gaps get filled in by actual scientists doing real ... They claim that the missing pieces came in on a meteor. ... Now by saying essentially that a big rock just fell out ...
      (talk.origins)
    • Re: [PATCH 1/2] elf loader support for auxvec base platform string
      ... > benefit from knowledge of the underlying CPU model. ... In cases that matter you admit that AT_BASE_PLATFORM takes precedence, ... It's not a matter of buggy software, ...
      (Linux-Kernel)