gnc-date.c - erroneous leap year calculations.
Derek Atkins
warlord at MIT.EDU
Sun Feb 6 15:57:46 EST 2005
Applied to 1.8 and HEAD. Thanks for noticing. This should make
the 1.8.11 cutoff (the last thing.. Phew. Thanks Chris!). I wonder
how nobody noticed this issue ever before?
-derek
Neil Williams <linux at codehelp.co.uk> writes:
> Ummm, I've just found something in gnc-date.c that appears to have slipped
> through the net.
>
> In gnc-date.c, there is a function gnc_date_my_last_mday which I wanted to use
> in my own QOF work. When I tried to calculate the last day of the month of
> February in 2005, it came back with the 3rd March. Other months were wrong
> too - the last day of 2004 was the 30th December!
>
> I looked at the source, and it would appear that where a modulus was expected,
> a division was executed:
>
[snip]
> Now, the last day of February 2005 really is the 28th and the last day of 2004
> is the 31st December. Phew!
>
> (I didn't fancy a world without New Year's Eve!!!)
>
> I'll amend QOF at this end.
--
Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
Member, MIT Student Information Processing Board (SIPB)
URL: http://web.mit.edu/warlord/ PP-ASEL-IA N1NWH
warlord at MIT.EDU PGP key available
More information about the gnucash-patches
mailing list