Click here to Skip to main content
15,899,754 members
Home / Discussions / C#
   

C#

 
AnswerRe: Maximum value display.... Pin
dan!sh 12-Sep-09 7:01
professional dan!sh 12-Sep-09 7:01 
GeneralRe: Maximum value display.... Pin
greendragons12-Sep-09 7:07
greendragons12-Sep-09 7:07 
GeneralRe: Maximum value display.... Pin
dan!sh 12-Sep-09 7:18
professional dan!sh 12-Sep-09 7:18 
GeneralRe: Maximum value display.... Pin
greendragons12-Sep-09 7:26
greendragons12-Sep-09 7:26 
GeneralRe: Maximum value display.... Pin
greendragons12-Sep-09 7:38
greendragons12-Sep-09 7:38 
GeneralRe: Maximum value display.... Pin
dan!sh 12-Sep-09 7:53
professional dan!sh 12-Sep-09 7:53 
GeneralRe: Maximum value display.... Pin
greendragons12-Sep-09 8:02
greendragons12-Sep-09 8:02 
AnswerRe: Maximum value display.... Pin
Luc Pattyn12-Sep-09 8:10
sitebuilderLuc Pattyn12-Sep-09 8:10 
Hi,

your problem is not related to the formatting string in some ToString() method, it is much more fundamental.

real numbers are not capable of storing all the information that would be required to show all the digits of large numbers, that is exactly why they show at most 7 (float) or 16 (double) digits and tell you by which power of 10 the number needs to be multiplied.

integers keep all information accurately until they reach their maximum value; for int (Int32) that would be around 2 billion, much less than what you want. To store your 10^100 value as an integer, one would need over 300 bytes, whereas regular integers only hold 4 or 8 bytes of data.

decimals are somewhere in the middle, they won't solve it either.
What you need is some special type, often called BigInt, BigInteger, BigNumber; google for those. There are some articles here on CodeProject about them. And C# 4.0 holds a class that could help you.

Smile | :)

Luc Pattyn

Have a look at my entry for the lean-and-mean competition; please provide comments, feedback, discussion, and don’t forget to vote for it! Thank you.

Local announcement (Antwerp region): Lange Wapper? Neen!


GeneralRe: Maximum value display.... Pin
greendragons12-Sep-09 8:18
greendragons12-Sep-09 8:18 
AnswerRe: Maximum value display.... Pin
Luc Pattyn12-Sep-09 8:27
sitebuilderLuc Pattyn12-Sep-09 8:27 
QuestionHow to get a dictionary for word translations? Pin
Shaunr8812-Sep-09 5:42
Shaunr8812-Sep-09 5:42 
AnswerRe: How to get a dictionary for word translations? Pin
Richard MacCutchan12-Sep-09 5:52
mveRichard MacCutchan12-Sep-09 5:52 
GeneralRe: How to get a dictionary for word translations? Pin
Shaunr8812-Sep-09 6:07
Shaunr8812-Sep-09 6:07 
GeneralRe: How to get a dictionary for word translations? Pin
Jayapal Chandran12-Sep-09 10:54
Jayapal Chandran12-Sep-09 10:54 
QuestionAccess Pin
sanforjackass12-Sep-09 5:35
sanforjackass12-Sep-09 5:35 
AnswerRe: Access Pin
Henry Minute12-Sep-09 5:37
Henry Minute12-Sep-09 5:37 
GeneralRe: Access Pin
sanforjackass12-Sep-09 5:47
sanforjackass12-Sep-09 5:47 
GeneralRe: Access Pin
Henry Minute12-Sep-09 5:59
Henry Minute12-Sep-09 5:59 
GeneralRe: Access Pin
sanforjackass12-Sep-09 6:06
sanforjackass12-Sep-09 6:06 
AnswerRe: Access Pin
dan!sh 12-Sep-09 6:21
professional dan!sh 12-Sep-09 6:21 
AnswerRe: Access Pin
cjb11014-Sep-09 3:47
cjb11014-Sep-09 3:47 
Questionextracting images from pdf , creating image from an individual pdf page Pin
Jayapal Chandran12-Sep-09 5:11
Jayapal Chandran12-Sep-09 5:11 
AnswerRe: extracting images from pdf , creating image from an individual pdf page Pin
Henry Minute12-Sep-09 5:34
Henry Minute12-Sep-09 5:34 
QuestionAlternating output of two dictionaries Pin
ated8712-Sep-09 4:24
ated8712-Sep-09 4:24 
AnswerRe: Alternating output of two dictionaries Pin
Luc Pattyn12-Sep-09 5:13
sitebuilderLuc Pattyn12-Sep-09 5:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.