AVR C Runtime Library - Bugs: bug #44327, eu_dst() is broken
You are not allowed to post comments on this tracker with your current authentication level.
bug #44327: eu_dst() is broken
Submitter: | None | ||
Submitted: | Fri 20 Feb 2015 09:27:48 PM UTC | ||
Category: | Library | Severity: | 3 - Normal |
Priority: | 5 - Normal | Item Group: | Header files |
Status: | None | Assigned to: | None |
Percent Complete: | 0% | Originator Email: | -email is unavailable- |
Open/Closed: | Open | Release: | Any |
Fixed Release: | None |
Fri 11 Oct 2019 09:21:14 AM UTC, comment #1: |
Mark Moore <robotto> |
Fri 20 Feb 2015 09:27:48 PM UTC, original submission:
The function eu_dst(), defined in include/util/eu_dst.h, is intended to
|
Anonymous |
Depends on the following items: None found
Items that depend on this one: None found
Follow 2 latest changes.
Date | Changed by | Updated Field | Previous Value | => | Replaced by |
---|---|---|---|---|---|
2019-10-11 | robotto | Attached File | - | Added dstCheck.py, #47647 | |
2016-09-21 | the2masters | Carbon-Copy | - | Added -email is unavailable- |
Powered by Savane 3.13-02a9.
Corresponding source code
The current algorithm misfires if the month starts on a Thursday, in which case d is calculated to be 31, when it should have been 24.
Adding the following after line 91 fixes it:
it does impact the elegance of the algorithm somewhat, and probably performance, but only on months that start on a thursday ;)
I have attached a python script that runs the algorithm 31*7 times, simulating each day of a month (0-30) being each day of the week (0-6), the script prints out an error if any calculation doesn't match the hard-coded truth table.
~Mark
(file #47647)