It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming Visual Basic Forum

need help with numbers in VB

Moderator: dafunkymunky

need help with numbers in VB

Postby ukamed on Sun Aug 17, 2008 10:28 pm

I am using Visual Basic 2005, and I am new in VB, so I had to do something like factorial of the number, and I did that part but sometimes it gives me numbers like this one 1.1684908531676833E+021, as you can see there is an "E" (sorry about my english as I dont know how do you call this in english, may be exponent!!!!) and when I want to add another number to the first one VB is giving me an error. Example

X = 1.1684908531676833E+021
Y = 70
when I try this
x+y it is giving me the error, and I think the "E" is the problem, can soemone telling me how can I fix this, hope u understood me??


Thanx in advance


Luca Bertone
ukamed
 
Posts: 3
Joined: Mon Aug 11, 2008 11:05 pm

Postby mmkhetan on Sun Aug 24, 2008 5:56 am

If you have declared your variable x or y as integer then only you may face the problem. otherwise there should not be any problem. however the results will be still the same = 1.1684908531676833E+021, as the value of Y is too small to effect the results and will be same as x only.
I am using vb6 and this expression does not give any probelm in evaluating it.
mmkhetan
 
Posts: 4
Joined: Sun Aug 17, 2008 12:40 pm
Location: Hyderabad, INDIA

Postby ukamed on Sun Aug 24, 2008 8:03 am

thanx for reply,

But no, that's not the problem, the problem is that VB 2005 it gives an error when trying to calculate x+y! Hope you understand what I am saying..
ukamed
 
Posts: 3
Joined: Mon Aug 11, 2008 11:05 pm


Who is online

Users browsing this forum: Yahoo [Bot] and 6 guests