Skip to content

2026.08.18

Choose a tag to compare

@rizukirr rizukirr released this 18 Aug 14:27
· 50 commits to main since this release
082159e

Headers in this release

Header Version Changed since v0.1.0
prayertimes.h v0.1.1 Yes
hijri.h v0.1.0 No
timezone.h v0.1.0 No

The tag is a calendar date and the headers carry their own semantic versions, so these numbers are not meant to match. Pin a download to the tag. Reason about compatibility from the header version. Each header explains this in its own banner, since a vendored file travels alone.

This is the first calendar-dated release. v0.1.0 keeps its name.

Fixed

The time formatters could emit a field no parser could read back. format_time_hm and format_time_hms cast to int before reducing, and the cast truncates toward zero, so any hour below zero produced a negative minute field. Non-finite input was worse, because (int)NAN is undefined behaviour.

before                        after
-0.104  -> "00:-6"            -> "23:54"
-0.104  -> "00:-6:-13"        -> "23:53:46"
   NaN  -> "-8:-2147483648"   -> "--:--"
   NaN  -> "-8:-35791394:-8"  -> "--:--:--"

Both inputs are reachable rather than hypothetical. The fajr and isha high-latitude fallback returns hours outside 0 to 24 on 107 days a year at Reykjavik and 23 at Anchorage, and the unguarded hour_angle call sites return NaN above 66 degrees north.

No computed time moved. The 895 published-table comparisons kept their 449, 435, 11 residual distribution across the change.

Documented

struct PrayerTimes had no doc comment at all. It now states both ways a field departs from an ordinary hour of the day, and seven checks pin the measured figures so the comment cannot drift from the code.

A field can be NaN, because above roughly 66 degrees the Sun may never reach the altitude an event is defined by. A field can also fall outside 0 to 24, meaning the event lands on the previous or the next calendar day.

The second is worth reading before you use this library at high latitude, because mishandling it looks like tidying up. The double is the only thing carrying the day offset, so reducing a field into 0 to 24 before building a timestamp moves the event silently onto the wrong day.

Known limits

Above roughly 66 degrees north or south, several fields are non-finite, and the fajr and isha high-latitude fallback is itself non-finite there because it is defined in terms of a sunset and sunrise that do not occur. dhuha reaches this first, from about 62.5 degrees. Tracked in #51, with the convention research and its primary sources in docs/research/2026-08-18-high-latitude-conventions.md.

Whether struct PrayerTimes should carry the day offset explicitly is open in #56.

Checks

932 in the published-table suite, 14236 in the oracle suite, 209 in the timezone suite. make check covers C11, C++17, the examples and the research baseline.