antic
Perch
Hey all,
I got this seriously twisted exception in VB.NET. Never seen this before...
I have a variable (Single precision) which contains the results of a calculation. The result is 75.20834 when I print it out.
But when I try to assign it to an integer as follows, I get an "overflow" exception!
intResult = CInt(sngResult)
intResult is an Integer, sngResult is a Single.
However, when I do something like Response.Write CInt(sngResult), it works fine!! Assigning CInt(sngResult) to an Integer variable is giving me an overflow error!
Anyone know why this is? Drove me nuts until I accepted it was a .net quirk that I didn't fully understand.
I got this seriously twisted exception in VB.NET. Never seen this before...
I have a variable (Single precision) which contains the results of a calculation. The result is 75.20834 when I print it out.
But when I try to assign it to an integer as follows, I get an "overflow" exception!
intResult = CInt(sngResult)
intResult is an Integer, sngResult is a Single.
However, when I do something like Response.Write CInt(sngResult), it works fine!! Assigning CInt(sngResult) to an Integer variable is giving me an overflow error!
Anyone know why this is? Drove me nuts until I accepted it was a .net quirk that I didn't fully understand.