Integer value Rotation problem
-
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:
-
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:
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] -
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:
Can't you simply use unsigned values ? :confused:
Cédric Moonen Software developer
Charting control [v3.0] OpenGL game tutorial in C++ -
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:
-
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]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.
-
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.
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] -
You are going to have to add an event handler for OnChange so that you check the input on edit.
i got it thanks yaar.