|
-
May 28th, 2002, 11:07 PM
#1
exact representation of double
Does anyone know how to exactly represent doubles like "0.1". I know that binary representation of decimal numbers are not always exact. What I am looking for is a technique to work around this problem.
when you do something like
double x = 0.1;
internally x is "0.10000..000001" (may have missed some zeros, but that is irrelevant; what is important here is the trailing 1)
what I want is to store x in some way so that it is "0.10000 ...00"
Also, some comments on double comparison will be helpful. I know about the "delta" technique; does anyone know of any other?
Your help is much appreciated.
Thanks.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|