The module calendar
The days of the months of the Gregorian calendar.
This version has a fault: it forgets the rule of the 400 years, so the year 2000 has 365 days and February 2000 has 28. The module calendar_fixed corrects it with the same description of each export: the system can give calendar_fixed to each module that imports this one.
What it is for. It is the module with a fault that the replacement of an import corrects. agenda imports it; the process imports and the console show the fault and its correction with no new build of agenda.
Example, in the console: load("calendar"), then days_in_month(2, 2000) gives 28; the true answer is 29.
calendar module with no entry
- Hash
88dcc066f9f20a484c3f9cf5649831b6d7084546a639c52cb4be595bdd2881a9- Size
12288 bytes- Exports
1- Imports
0- Imported by
2- License
- MIT
The days of the months of the Gregorian calendar
| Fact | Value |
|---|---|
| Kind | Modules with no entry |
| Source | src/modules/libraries/calendar |
| Boot image | yes: in the boot image, 12288 bytes in this build |
| Build settings | none: the defaults of the source |
| Imports | none |
| Imported by |
Neighbours
What it imports, at its left, and what imports it, at its right: the part of the module graph that touches it.
Exports
| Export | What it does |
|---|---|
days_in_month(month: Integer, year: Integer) -> Integer | gives the count of days of a month, from 1 to 12, of a year |
days_in_month
days_in_month(month: , year: ) ->
days_in_month gives the count of days of a month, from 1 to 12, of a year. A month out of this range stops the process on a bounds check.
The fault: a year that 100 divides is never a leap year here, so February 2000 has 28 days.
month:year:
src/modules/libraries/calendar/calendar.odin:17
Read from the source of the module, as the build reads it to describe the exports (tools/modustool/build/describe.odin).
Integer wire form
A wire form of the module contract: one word of a call. A signed integer of 64 bits, in a register.
