1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
// Copyright 2026 Regit.io — Nicolas Koenig
// SPDX-License-Identifier: Apache-2.0
//! 1/1 — the OIS-shortcut / legacy day-count convention.
//!
//! 1/1 is the degenerate convention: every interval, regardless of length,
//! direction, or endpoint placement, maps to the year-fraction `1.0`. The
//! function ignores its two arguments entirely — they are accepted only so
//! the signature lines up with every other fraction in this crate's
//! dispatcher, where each arm takes `(start, end)` of type [`Date`].
//!
//! Despite the historical "Act/Act" tagline some terminology lists attach
//! to 1/1, this convention is **not** Act/Act in any meaningful sense:
//! it does not count actual days, it does not divide by an actual year
//! length, and it is not additive over splits. Every interval has fraction
//! `1` flat. The name "1/1" makes the procedure transparent — numerator 1,
//! denominator 1 — and the section heading in the OIS-shortcut literature
//! is preserved here so the convention is searchable by its conventional
//! label rather than by what it numerically does.
//!
//! # Use case — the OIS shortcut
//!
//! The convention exists as a placeholder inside the schedule of an
//! overnight-indexed-swap (OIS) contract. In an OIS, the floating coupon
//! is the geometric compound of the overnight rate over the accrual
//! period; the daily compounding does *all* the time-weighting work
//! internally. Once that compounded rate has been computed, multiplying
//! it by the period's year-fraction would double-count the time
//! dimension. Setting the day-count to 1/1 — so that the multiplier is
//! the identity — is the standard shortcut that keeps the cashflow
//! formula uniform across conventions: `payment = notional * rate *
//! fraction(start, end)` with `fraction ≡ 1` on the OIS leg.
//!
//! # Algorithm
//!
//! ```text
//! fraction(_, _) = 1.0
//! ```
//!
//! # References
//!
//! - ISDA OIS terminology notes (the "1/1" / "Act/Act" placeholder on
//! compounded-rate legs).
use crateDate;
/// Computes the 1/1 year fraction.
///
/// Returns `1.0` for every input. Both `start` and `end` are accepted for
/// API uniformity with the other day-count fractions in this crate but
/// are not used in the computation — the procedure is constant. See the
/// module-level docstring for the OIS-shortcut motivation and a fuller
/// note on why the result is `1.0` even for the degenerate
/// `fraction(d, d)` and inverted `fraction(end, start)` cases.
///
/// # Examples
///
/// ```
/// use regit_daycount::Date;
/// use regit_daycount::day_count::one_one;
///
/// // The function is identically `1.0` — every interval, every direction.
/// let start = Date::ymd(2026, 1, 1).unwrap();
/// let end = Date::ymd(2026, 4, 1).unwrap();
/// assert_eq!(one_one::fraction(start, end), 1.0);
/// ```