Skip to content
Draft
Show file tree
Hide file tree
Changes from 13 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
34 changes: 28 additions & 6 deletions docs/reference/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,19 +1,41 @@
cmake_minimum_required(VERSION 3.25.0)
project(mp_units_reference_documentations LANGUAGES NONE)
# The MIT License (MIT)
#
# Copyright (c) 2018 Mateusz Pusz
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

cmake_minimum_required(VERSION 3.19.0)
project(mp-units-reference-documentations LANGUAGES NONE)

include(JEGPAddStandardeseSources)

set(pdf_title "Mp-units Library")
set(pdf_title "mp-units - A Physical Quantities and Units library for C++")
set(page_license "MIT License")
set(first_library_chapter "nums")
set(last_library_chapter "qties")
# set(pdf_creator "Johel Ernesto Guerrero Pe\\~{n}a")
# set(pdf_creator "") # Defaults to "the `user.name` of Git's configuration".
# set(document_number [[\unspec]])
# set(previous_document_number [[\unspec]])
set(cover_title "Mp-units Library Reference Documentations")
set(cover_title "mp-units Library Reference Documentations")
set(reply_to "\\href{${PROJECT_HOMEPAGE_URL}/discussions}{Discussions}, \\href{${PROJECT_HOMEPAGE_URL}/issues}{issues}")
jegp_add_standardese_sources(
mp_units_reference_documentations
mp-units-reference-documentations
LIBRARIES intro numbers;quantities
EXTENSIONS macros_extensions
# CHECKED TRUE
Expand Down
2 changes: 0 additions & 2 deletions docs/reference/codeblock/.clang-format

This file was deleted.

6 changes: 3 additions & 3 deletions docs/reference/intro.tex
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@

\indexdefn{modulo}%
\definition{modulo}{def.mod}
operation performed on a set for which a division\irefiev{102-01-21} and an addition are defined,
operation performed on a set for which a division\irefiev{102-01-21} and an addition\irefiev{102-01-11} are defined,
the result of which, for elements $a$ and $b$ of the set,
is the unique element $r$, if it exists in the set,
such that $a = \lfloor a/b \rfloor b + r$
Comment on lines +88 to +93
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not consistent with how modulo operation on quantities works.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we use https://eel.is/c++draft/expr.mul#4 instead of redefining the operation?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not consistent with how modulo operation on quantities works.

I think you're referring to the cases for which the modulo of quantity was made ill-formed.
This term modulo is used by a concept which already checks for its validity.
And when it is valid, it better behaves like this.

Shouldn't we use https://eel.is/c++draft/expr.mul#4 instead of redefining the operation?

I did consider that.
I saw value in phrasing it like division.
That's certainly correct,
and doesn't run the risk of a bad specification due to saying something like
"behaves like % for integral operands".

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Collaborator Author

@JohelEGP JohelEGP Sep 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you.
I think it's well defined as is.
1695486055
1695486063
1695486070
1695486074
1695486082
1695486098
q % r performs the modulo in the set that is the common type of the arguments,
so the quotient-remainder theorem holds.

It does seem surprising because q and r are mapped to the common type before the modulo,
and so a and b in the definition of modulo correspond to the value of the converted arguments.
So the quotient-remainder theorem doesn't work on the actual input arguments in code.

Expand Down Expand Up @@ -147,8 +147,8 @@

\begin{multicolfloattable}{mp-units library headers}{headers.mp.units}
{l}
\tcode{<mp_units/numbers.h>} \\
\tcode{<mp_units/quantity.h>} \\
\tcode{<mp-units/numbers.h>} \\
\tcode{<mp-units/quantity.h>} \\
\end{multicolfloattable}

\rSec1[spec.reqs]{Library-wide requirements}
Expand Down
2 changes: 0 additions & 2 deletions docs/reference/itemdecl/.clang-format

This file was deleted.

Loading