Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C# - problem with very small numbers - not enough digits in double datatype

I'm writing a program in C# which suppose to calculate very small numbers. However, all my calculations are getting NaN value because they are too small for the 'double' datatype.

Is there an option in C# to deal with such situations?

Thanks, Eden.

like image 835
Eden Avatar asked Jan 29 '10 23:01

Eden


1 Answers

try decimal

Edit: Also, .NET 4 introduces BigInteger which could probably be used to represent whatever floating point values\data range you are trying to represent.

like image 129
RedDeckWins Avatar answered Oct 17 '22 22:10

RedDeckWins