File tree Expand file tree Collapse file tree 1 file changed +6
-20
lines changed Expand file tree Collapse file tree 1 file changed +6
-20
lines changed Original file line number Diff line number Diff line change 21856
21856
\begin{itemdescr}
21857
21857
\pnum
21858
21858
\returns
21859
- \begin{codeblock}
21860
- month{modulo(static_cast<long long>(unsigned{x}) + (y.count() - 1), 12) + 1}
21861
- \end{codeblock}
21862
- where \tcode{modulo(n, 12)} computes the remainder of \tcode{n} divided by 12 using Euclidean division.
21863
- \begin{note}
21864
- Given a divisor of 12, Euclidean division truncates towards negative infinity and
21865
- always produces a remainder in the range of \crange{0}{11}.
21866
- Assuming no overflow in the signed summation,
21867
- this operation results in a \tcode{month} holding a value in the range \crange{1}{12} even if \tcode{!x.ok()}.
21868
- \end{note}
21859
+ A \tcode{month} with \tcode{m_} equal to the sum of \tcode{unsigned\{x\}}
21860
+ and \tcode{y.count()}, reduced modulo 12 to an integer in the range
21861
+ \crange{1}{12}.
21869
21862
\begin{example}
21870
21863
\tcode{February + months\{11\} == January}.
21871
21864
\end{example}
22564
22557
\begin{itemdescr}
22565
22558
\pnum
22566
22559
\returns
22567
- \begin{codeblock}
22568
- weekday{modulo(static_cast<long long>(unsigned{x}) + y.count(), 7)}
22569
- \end{codeblock}
22570
- where \tcode{modulo(n, 7)} computes the remainder of \tcode{n} divided by 7 using Euclidean division.
22571
- \begin{note}
22572
- Given a divisor of 7, Euclidean division truncates towards negative infinity and
22573
- always produces a remainder in the range of \crange{0}{6}.
22574
- Assuming no overflow in the signed summation,
22575
- this operation results in a \tcode{weekday} holding a value in the range \crange{0}{6} even if \tcode{!x.ok()}.
22576
- \end{note}
22560
+ A \tcode{weekday} with \tcode{wd_} equal to the sum of \tcode{unsigned\{x\}}
22561
+ and \tcode{y.count()}, reduced modulo 7 to an integer in the range
22562
+ \crange{0}{6}.
22577
22563
\begin{example}
22578
22564
\tcode{Monday + days\{6\} == Sunday}.
22579
22565
\end{example}
You can’t perform that action at this time.
0 commit comments