|
-
Jun 1st, 2001, 08:16 AM
#1
Thread Starter
New Member
variable types
I am trying to write a vb component, which receives values from an asp page and then makes some calculations before returning the value. However, as I am fairly new to this game, it is coming up with an error saying 'overflow'!
The values I pass into the component are integers. These are then multiplied with some constant values, which can be anything up to 50000. I therefore stored these in a variable of type long. This value is then multiplied by 0.10, to give a percentage. The function then returns the value back to the asp page as a variable type double.
I hope this makes sense, and would appreciate it very much if anyone could suggest where I am going wrong.
-
Jun 2nd, 2001, 04:37 AM
#2
Lively Member
The number after multiplication is too large to be stored in a long variable, I would suggest perhaps dividing by .10 before multiplying, the calculation will produce the same result but the number should not 'overflow' the variable if you do it this way.
Hope this is of help.
Best regards,
Rob Brown.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|