By whole number I mean: A number that doesn't contain a fraction, so not too

sure what you mean by "can never become 'inaccurate' " basically I am trying

to write a program that finds primary numbers I have been told that once I

reach the limit of what a variable type can hold and lets say add 1, it

doesnâ€™t through an error it just provides me with an incorrect "random"

number. Thus why I want to find out what is the best variable type to for

this project (find primary numbers) and also know what the limitations are

within the .net framework for very long numbers and whether there are any

special classes (free or commercial to hold very large numbers

hundred/thousands of digits).

"Jon Skeet [C# MVP]" wrote:

John <Jo**@discussions.microsoft.comwrote:
Which variable type (c#) can whole the largest whole number? I know this

sounds silly but as double and decimal are made for numbers with decimals I

am not sure.

Also if anybody knows of any library for .NET that would allow me to deal

with **VERY** large whole numbers.

Well, what are your restrictions? For instance, the range of double is

much greater than the range of decimal, and it will store a bigger

whole number - but it won't store *every* whole number within that

range accurately.

Decimal, however, can never become "inaccurate" at 0DP - in other

words, it will always accurately represent whole numbers, and it can

store any whole number within its range.

--

Jon Skeet - <sk***@pobox.com>

http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet

If replying to the group, please do not mail me too