Link to home
Start Free TrialLog in
Avatar of bezier98
bezier98Flag for Hong Kong

asked on

Handle significant figures in VB.NET

Dear all,

  I am trying to handle calculation between numbers, with 25 significant figures (e.g. 123456.7890123456789012345) and seems even double can not handle figures like that.

  Are there any simple way in VB.NET to handle these kind of numbers? except cut the numbers into parts.

  Thanks.

Regs,
Bezier
ASKER CERTIFIED SOLUTION
Avatar of checoo
checoo

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of bezier98

ASKER

Acutally I did use decimal type, but at the begining, it doesn't work, but now I know the reason.

I try the following

Dim x as decimal

x = "123456.7890123456789012345"
msgbox (x + 0.0000000000000000001)

the result will turn out to be 12345.789012346

which I think VB treated 0.0000000000000000001 as double

After assigned 0.0000000000000000001 to another decimal y, then
msgbox(x + y) will give the exact answer

Anyway, thanks for helping

Bezier