Re: Paranoic about real number imprecisions

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Nicholas Paldino [.NET/C# MVP] (mvp_at_spam.guard.caspershouse.com)
Date: 08/27/04


Date: Fri, 27 Aug 2004 09:00:18 -0400


    You can not count on double, as it has the same problem that a float
has.

    You should use the Decimal type. It will store numbers with a large
amount of decimal places accurately.

    Hope this helps.

-- 
               - Nicholas Paldino [.NET/C# MVP]
               - mvp@spam.guard.caspershouse.com
"Zürcher See" <aquila@cannabismail.com> wrote in message 
news:%23Tq2P9CjEHA.3536@TK2MSFTNGP12.phx.gbl...
> Once I had the same problem, I have to calculate some value and compare
> them,
> with float I have always precision errors, with double never.
>
>
> "Pavils Jurjans" <pavils@mailbox.riga.lv> schrieb im Newsbeitrag
> news:OKK5QmCjEHA.3944@tk2msftngp13.phx.gbl...
>> > Why you don't use double?
>>
>> Using double type will not save from this problem.
>>
>> Pavils
>>
>>
>
> 


Relevant Pages

  • Re: Convert class
    ... Float is an alias provided by C#. ... Nicholas Paldino [.NET/C# MVP] ... > Sometimes I can't work with a float field because there isn't this method> and I need it to, for example, convert the input in a textBox to a float> field. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: question about Trim
    ... Microsoft C# MVP ... Conversation: question about Trim ... how can i take a float number and make it's lengeth to be only 3 or 4 ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: FloatToInt32Bits and Int32BitsToFloat
    ... int i = BitConverter.ToInt32); ... float f = BitConverter.ToSingle); ... Mattias Sjögren [MVP] mattias @ mvps.org ... Please reply only to the newsgroup. ...
    (microsoft.public.dotnet.framework)
  • Re: how to check if CEdit input is a number or not?
    ... Take a look at my validating edit control on my MVP Tips site. ... the number can be int, float, double, scientific,... ...
    (microsoft.public.vc.mfc)
  • Re: How to programmactially place the tool bar float in a point
    ... Use CFrameWnd::FloatControlBar to float. ... Ajay Kalra [MVP - VC++] ... > My program has a couple of toolbars. ...
    (microsoft.public.vc.mfc)