View Full Version : overflow problem in 1 line :S

04-02-2007, 11:49 AM
Hi there, I've got an overflow in this line:

<%=Round((Clng(nrOfGeenInteresse) / (Clng(nrOfGeenInteresse) + Clng(nrOfDeelnames))) * 100,2)%>%";

I've tried it with cint, int and clng..though the overflow error remains.. :S
How come ?

04-02-2007, 12:17 PM
perhaps you can split this oneliner into a few lins, to see where it goes wrong exactly:

lngNrOfGeenInteresse = Clng(nrOfGeenInteresse)
lngNrOfDeelnames = Clng(nrOfDeelnames)
quotient = lngNrOfGeenInteresse / (lngNrOfGeenInteresse + lngNrOfDeelnames)
percentage = quotient * 100
Round(percentage, 2)
also you might want to spit out the values of some of these variables with response.write

04-02-2007, 02:18 PM
Check the character length of what is being passed in. I copied your code and supplied my own numbers and it was fine until I entered a number of 10 digits, at which time I also received an overflow error.

04-02-2007, 07:08 PM
Also, check to make sure that none of your numbers is 0.

Since you are doing mathematical calculations including division. If you have a 0 as the divisor you will get an Overflow, as the dividend, a DIV BY 0 error.