Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Integer value Rotation problem

Integer value Rotation problem

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestioncom
7 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    rrthangavel
    wrote on last edited by
    #1

    Hi All, As we know integer has value limitation's(ex +_32767) depends upon bit range(ex 32 bit,16 bit). i'm working with an integer variable which gets input from text box(designed as Activex control). my condition is if the user enters the value in text box greater than 10 means it should show the error symbol otherwise correct symbol. so the problem is if i enter the value 10 to 36767 means it shows alert symbol. if it is above 32767 means it shows correct symbol. How can i solve this integer value Rotation Problem? waiting for u :rose:

    CPalliniC C S 3 Replies Last reply
    0
    • R rrthangavel

      Hi All, As we know integer has value limitation's(ex +_32767) depends upon bit range(ex 32 bit,16 bit). i'm working with an integer variable which gets input from text box(designed as Activex control). my condition is if the user enters the value in text box greater than 10 means it should show the error symbol otherwise correct symbol. so the problem is if i enter the value 10 to 36767 means it shows alert symbol. if it is above 32767 means it shows correct symbol. How can i solve this integer value Rotation Problem? waiting for u :rose:

      CPalliniC Offline
      CPalliniC Offline
      CPallini
      wrote on last edited by
      #2

      rrthangavel wrote:

      As we know integer has value limitation's(ex +_32767) depends upon bit range(ex 32 bit,16 bit).

      It is (usually) -32768..32767 for signed shorts.

      rrthangavel wrote:

      How can i solve this integer value Rotation Problem?

      Do you mean wrap-around problem? It depends on how much control you have on the input. For instance, if you can read the input string, then a length > 2 is an error condition. :)

      If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
      This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
      [My articles]

      In testa che avete, signor di Ceprano?

      L 1 Reply Last reply
      0
      • R rrthangavel

        Hi All, As we know integer has value limitation's(ex +_32767) depends upon bit range(ex 32 bit,16 bit). i'm working with an integer variable which gets input from text box(designed as Activex control). my condition is if the user enters the value in text box greater than 10 means it should show the error symbol otherwise correct symbol. so the problem is if i enter the value 10 to 36767 means it shows alert symbol. if it is above 32767 means it shows correct symbol. How can i solve this integer value Rotation Problem? waiting for u :rose:

        C Offline
        C Offline
        Cedric Moonen
        wrote on last edited by
        #3

        Can't you simply use unsigned values ? :confused:

        Cédric Moonen Software developer
        Charting control [v3.0] OpenGL game tutorial in C++

        1 Reply Last reply
        0
        • R rrthangavel

          Hi All, As we know integer has value limitation's(ex +_32767) depends upon bit range(ex 32 bit,16 bit). i'm working with an integer variable which gets input from text box(designed as Activex control). my condition is if the user enters the value in text box greater than 10 means it should show the error symbol otherwise correct symbol. so the problem is if i enter the value 10 to 36767 means it shows alert symbol. if it is above 32767 means it shows correct symbol. How can i solve this integer value Rotation Problem? waiting for u :rose:

          S Offline
          S Offline
          SnowHow
          wrote on last edited by
          #4

          You are going to have to add an event handler for OnChange so that you check the input on edit.

          R 1 Reply Last reply
          0
          • CPalliniC CPallini

            rrthangavel wrote:

            As we know integer has value limitation's(ex +_32767) depends upon bit range(ex 32 bit,16 bit).

            It is (usually) -32768..32767 for signed shorts.

            rrthangavel wrote:

            How can i solve this integer value Rotation Problem?

            Do you mean wrap-around problem? It depends on how much control you have on the input. For instance, if you can read the input string, then a length > 2 is an error condition. :)

            If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
            This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
            [My articles]

            L Offline
            L Offline
            Luc Pattyn
            wrote on last edited by
            #5

            00000000000000000000000000000000000000000000000000000000000000000001 :)

            Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum

            Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.

            CPalliniC 1 Reply Last reply
            0
            • L Luc Pattyn

              00000000000000000000000000000000000000000000000000000000000000000001 :)

              Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum

              Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.

              CPalliniC Offline
              CPalliniC Offline
              CPallini
              wrote on last edited by
              #6

              That's simply silly and the user must be punished for... :-D

              If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
              This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
              [My articles]

              In testa che avete, signor di Ceprano?

              1 Reply Last reply
              0
              • S SnowHow

                You are going to have to add an event handler for OnChange so that you check the input on edit.

                R Offline
                R Offline
                rrthangavel
                wrote on last edited by
                #7

                i got it thanks yaar.

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups