Pankaj Saha

Pankaj Saha

  • NA
  • 8
  • 0

vb calculation is diffrent than C# calculation

Dec 8 2009 2:16 AM
Hi, I have a vb application, which contains lots of calculation and I am converting that application to asp.net C#. There are so many variables of double types in the vb application and I also took double in the c# for those variables. Now problem is that I do calculation with the same equation in both the application, however result value does not match. I have a variable var1 in vb the calculate double value is 1.63870925710649 (for vb) and 1.6387092571064941 (for c#), I do not understand why these values are different for the same datatype. And I have to use this variable in my equation, since both language has different value, this may be the reason of different final output. Some times I have to break the same equation into two or more equations for the C# , to get the same result in C# and sometimes I get the same result. But sometimes I get the value in c# which does not match the value of vb. I do not understand which calculation is right vb or C#.

Answers (1)