Google on "Bankers Rounding" on almost any computer news group and you'll find what you need. There will always be some error because some numbers just don't convert back and forth from rational to decimal without error. And of course there are 52.1667 weeks in a year so there's a source of error in itself. The best way to reduce the error is to do only one conversion between rational and decimal for each paycheck but that's not always practical. There are stories of early day programmers doing quite well for themselves by crediting the cumulative round error to their own accounts. Some of the stories may even be true :)
BobJ
----- Original Message ----- From: "Bob Woodward" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, November 30, 2004 4:21 PM
Subject: RE: [U2] [UD] Precision



You're counting weeks, not months.  A month does not divide by two
equally.  If you are getting two paychecks a month, then you get a
paycheck for (approximately) 15.2 days worth of work.  If you get a
paycheck every other week, you are getting it for 14 days work, exactly.

Bob Woodward
Programmer/Analyst
Harbor Wholesale Grocery
[EMAIL PROTECTED]


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:owner-u2-
[EMAIL PROTECTED] On Behalf Of Peter D Olson
Sent: Tuesday, November 30, 2004 12:52 PM
To: [EMAIL PROTECTED]
Subject: Re: [U2] [UD] Precision

52/2 = 26 paychecks ?????
2 * 12 = 24 paychecks ????
where the 2 missing paychecks ? ....

This e-mail, including attachments, may include confidential and/or
proprietary information, and may be used only by the person or entity
to
which it is addressed. If the reader of this e-mail is not the
intended
recipient or his or her authorized agent, the reader is hereby
notified
that any dissemination, distribution or copying of this e-mail is
prohibited. If you have received this e-mail in error, please notify
the
sender by replying to this message and delete this e-mail immediately.
-------
u2-users mailing list
[EMAIL PROTECTED]
To unsubscribe please visit http://listserver.u2ug.org/
-------
u2-users mailing list
[EMAIL PROTECTED]
To unsubscribe please visit http://listserver.u2ug.org/
-------
u2-users mailing list
[EMAIL PROTECTED]
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to