Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 168
  • Last Modified:

over flow

Hi experts

I am making a program which needs to calculate some numbers.

When the user input some very big numbers, the calculation may cause OVER FLOW and the program stopped!

How can I detect the calculating result will be over flow and avoid the program stopping?
0
victorlong
Asked:
victorlong
  • 2
  • 2
1 Solution
 
watyCommented:
Always work with variables big enough to receive the biggest possible value. You should use double or currency variables.

0
 
victorlongAuthor Commented:
Hi Waty

In my program, no matter what variables type I use, a user can always causes a over flow result. That is because the user doing something wrong and the program may not stop the user doing so.


0
 
watyCommented:
You could limit the entry at 10 characters (for example).

0
 
victorlongAuthor Commented:
Is this a good idea:

On error goto......
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now