Re: Why can't I get simple multipliation answer
- From: Jon Skeet [C# MVP] <skeet@xxxxxxxxx>
- Date: Sun, 26 Feb 2006 08:41:41 -0000
Amil <amilhanish@xxxxxxxxxxx> wrote:
I want to multiple two decimal numbers and get the normal result...instead,
I get a very large decimal result. Any idea how I can correct this problem?
double d1 = 5.21;
double d2 = 8.8;
double d = d1 * d2;
// d is now 45.848000000000006 in debugger or WriteLine
See http://www.pobox.com/~skeet/csharp/floatingpoint.html
--
Jon Skeet - <skeet@xxxxxxxxx>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
.
- References:
- Why can't I get simple multipliation answer
- From: Amil
- Why can't I get simple multipliation answer
- Prev by Date: Re: Windows Service and Remote Drive connection
- Next by Date: Re: Why can't I get simple multipliation answer
- Previous by thread: Re: Why can't I get simple multipliation answer
- Next by thread: Re: Windows Service and Remote Drive connection
- Index(es):