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 4427
4427
\begin {itemdescr }
4428
4428
\pnum
4429
4429
\returns
4430
- \begin {codeblock }
4431
- month{modulo(static_cast<long long>(unsigned{x}) + (y.count() - 1), 12) + 1}
4432
- \end {codeblock }
4433
- where \tcode {modulo(n, 12)} computes the remainder of \tcode {n} divided by 12 using Euclidean division.
4434
- \begin {note }
4435
- Given a divisor of 12, Euclidean division truncates towards negative infinity and
4436
- always produces a remainder in the range of \crange {0}{11}.
4437
- Assuming no overflow in the signed summation,
4438
- this operation results in a \tcode {month} holding a value in the range \crange {1}{12} even if \tcode {!x.ok()}.
4439
- \end {note }
4430
+ A \tcode {month} with \tcode {m_} equal to the sum of \tcode {unsigned\{ x\} }
4431
+ and \tcode {y.count()}, reduced modulo 12 to an integer in the range
4432
+ \crange {1}{12}.
4440
4433
\begin {example }
4441
4434
\tcode {February + months\{ 11\} == January}.
4442
4435
\end {example }
5135
5128
\begin {itemdescr }
5136
5129
\pnum
5137
5130
\returns
5138
- \begin {codeblock }
5139
- weekday{modulo(static_cast<long long>(unsigned{x}) + y.count(), 7)}
5140
- \end {codeblock }
5141
- where \tcode {modulo(n, 7)} computes the remainder of \tcode {n} divided by 7 using Euclidean division.
5142
- \begin {note }
5143
- Given a divisor of 7, Euclidean division truncates towards negative infinity and
5144
- always produces a remainder in the range of \crange {0}{6}.
5145
- Assuming no overflow in the signed summation,
5146
- this operation results in a \tcode {weekday} holding a value in the range \crange {0}{6} even if \tcode {!x.ok()}.
5147
- \end {note }
5131
+ A \tcode {weekday} with \tcode {wd_} equal to the sum of \tcode {unsigned\{ x\} }
5132
+ and \tcode {y.count()}, reduced modulo 7 to an integer in the range
5133
+ \crange {0}{6}.
5148
5134
\begin {example }
5149
5135
\tcode {Monday + days\{ 6\} == Sunday}.
5150
5136
\end {example }
You can’t perform that action at this time.
0 commit comments