Skip to content

[time.cal.month.nonmembers,time.cal.wd.nonmembers] Do not digress to … #1999

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 6 additions & 20 deletions source/time.tex
Original file line number Diff line number Diff line change
Expand Up @@ -4401,16 +4401,9 @@
\begin{itemdescr}
\pnum
\returns
\begin{codeblock}
month{modulo(static_cast<long long>(unsigned{x}) + (y.count() - 1), 12) + 1}
\end{codeblock}
where \tcode{modulo(n, 12)} computes the remainder of \tcode{n} divided by 12 using Euclidean division.
\begin{note}
Given a divisor of 12, Euclidean division truncates towards negative infinity and
always produces a remainder in the range of \crange{0}{11}.
Assuming no overflow in the signed summation,
this operation results in a \tcode{month} holding a value in the range \crange{1}{12} even if \tcode{!x.ok()}.
\end{note}
A \tcode{month} with \tcode{m_} equal to the sum of \tcode{unsigned\{x\}}
and \tcode{y.count()}, reduced modulo 12 to an integer in the range
\crange{1}{12}.
\begin{example}
\tcode{February + months\{11\} == January}.
\end{example}
Expand Down Expand Up @@ -5128,16 +5121,9 @@
\begin{itemdescr}
\pnum
\returns
\begin{codeblock}
weekday{modulo(static_cast<long long>(x.wd_) + y.count(), 7)}
\end{codeblock}
where \tcode{modulo(n, 7)} computes the remainder of \tcode{n} divided by 7 using Euclidean division.
\begin{note}
Given a divisor of 7, Euclidean division truncates towards negative infinity and
always produces a remainder in the range of \crange{0}{6}.
Assuming no overflow in the signed summation,
this operation results in a \tcode{weekday} holding a value in the range \crange{0}{6} even if \tcode{!x.ok()}.
\end{note}
A \tcode{weekday} with \tcode{wd_} equal to the sum of \tcode{x.wd_}
and \tcode{y.count()}, reduced modulo 7 to an integer in the range
\crange{0}{6}.
\begin{example}
\tcode{Monday + days\{6\} == Sunday}.
\end{example}
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy