CS majors know this topic as Numeric Analysis, and it has turned more than one
aspiring computer scientist toward another field of study. I recall my professor
freely borrowing letters from no fewer than four alphabets--Latin, Greek,
Hebrew, and Cyrillic--to fully expound on the topic. Taking notes was a royal
PITA; deciphering them was even worse.

The second time we took the course (two out of tree dropped or failed it), the
instructor (a different one) stuck to Latin and Greek letters, but the subject
matter was still a bitch. Ah, memories...

-----Original Message-----
From: Discussion of advanced .NET topics.
[mailto:[EMAIL PROTECTED] On Behalf Of John Warner
Sent: Monday, August 25, 2008 12:04 PM
To: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM
Subject: Re: [ADVANCED-DOTNET] Converting doubles into integers without rounding
errors
Importance: Low

<wink>Make your head spin is putting it mildly, a couple of those links
will make you consider giving up coding and seek a new career in digging
ditches. </wink> But you are right extremely informative.

John Warner



> -----Original Message-----
> From: Discussion of advanced .NET topics.
> [mailto:[EMAIL PROTECTED] On Behalf Of Peter Vertes
> Sent: Monday, August 25, 2008 12:59 PM
> To: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM
> Subject: Re: [ADVANCED-DOTNET] Converting doubles into
> integers without rounding errors
>
>
> If you are ready to make your head spin take a look at these pages:
>
> http://en.wikipedia.org/wiki/Bankers_rounding
> http://support.microsoft.com/kb/196652
> http://blogs.msdn.com/ericlippert/archive/2003/09/26/53107.aspx
>
> -Pete
>
> On Mon, Aug 25, 2008 at 12:51 PM, Curt Hagenlocher
> <[EMAIL PROTECTED]>wrote:
>
> > On Mon, Aug 25, 2008 at 9:48 AM, Peter Ritchie
> > <[EMAIL PROTECTED]> wrote:
> > >
> > > I would recommend something like this:
> > >
> > > double tempAmount = objMyObject.Amount * 100.0;
> > > uint nIntAmount = Math.Round(tempAmount);
> >
> > Ah, *that*'s where the rounding function is hiding.
> >
> > Or you could just use "Math.Round(amount, 2)" to round to
> the second
> > decimal place.
> >
> > --
> > Curt Hagenlocher
> > [EMAIL PROTECTED]
> >
> > ===================================
> > This list is hosted by DevelopMentor(R)  http://www.develop.com
> >
> > View archives and manage your subscription(s) at
> > http://discuss.develop.com
> >
>
> ===================================
> This list is hosted by DevelopMentorR  http://www.develop.com
>
> View archives and manage your subscription(s) at
> http://discuss.develop.com
>

===================================
This list is hosted by DevelopMentor.  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

===================================
This list is hosted by DevelopMentorĀ®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to