Results 1 to 5 of 5

Thread: < or <=

  1. #1

    Thread Starter
    Addicted Member Guru's Avatar
    Join Date
    May 2000
    Location
    sulking in the cupboard under the stairs
    Posts
    237

    Question < or <=

    does

    if(x<=20){

    }


    use more processing power than

    if(x<21){

    }


    ?
    Another light-hearted post from Guru

  2. #2
    Frenzied Member HarryW's Avatar
    Join Date
    Jan 2000
    Location
    Heiho no michi
    Posts
    1,827
    I doubt it; they are basically the same thing as far as the underlying microcode for the instruction is concerned. For integers at least.
    Harry.

    "From one thing, know ten thousand things."

  3. #3
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    AND and OR operations are performed on the bits that make up the number to determine which one is greater. They will take up the same amount of processing power because the determination for < and <= are all included within the circuitry. So I had studied...

  4. #4
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    Let me consult my logic design book (mano & kime)
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  5. #5
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    Bollox its at home.
    Never mind.
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width