Commit Graph
1826 Commits
Author SHA1 Message Date
Mateusz Pusz bb5c02e09e fix: Quantity inversion operation fixed
Resolves #367
2022-08-01 10:03:55 +02:00
Mateusz Pusz 5bd378a835 refactor: base_units_ratio.h renamed to absolute_magnitude.h 2022-07-31 15:45:40 +02:00
Mateusz Pusz 7cd168377f build(conan): Conanfile fixed after the last wrong commit 2022-07-30 14:30:16 +02:00
Mateusz Pusz 2e410278ba Revert "build(conan): cmake_layout import added too early by an accident"
This reverts commit 5efbda75d5.
2022-07-30 14:29:17 +02:00
Mateusz Pusz c74bd08cd5 Merge branch 'master' of github.com:mpusz/units 2022-07-30 14:24:51 +02:00
Mateusz Pusz 5efbda75d5 build(conan): cmake_layout import added too early by an accident 2022-07-30 10:57:59 +02:00
Mateusz Pusz d50ed286b3 Merge pull request #381 from JohelEGP/llvm16
refactor: update hacks for LLVM 16
2022-07-30 10:49:44 +02:00
Mateusz Pusz 6608c6dfd4 Merge pull request #379 from chiphogg/chiphogg/mag_
Explicitly qualify `mag<>` that initializes `mag` member
2022-07-30 10:44:37 +02:00
Johel Ernesto Guerrero Peña e988e1d74e refactor: update hacks for LLVM 16 2022-07-29 17:17:07 -04:00
Chip Hogg f6f7f9bafb Explicitly qualify mag<> that initializes mag member
This should fix clang's complaint.
2022-07-29 14:18:33 +00:00
Mateusz Pusz 1d3f3b26e4 Merge pull request #378 from chiphogg/chiphogg/mag
Rename `as_magnitude<...>()` to `mag<...>()`
2022-07-29 08:37:04 +02:00
Chip Hogg ea83af8aa9 Rename as_magnitude<...>() to mag<...>()
This is easier to write and to read.
2022-07-29 01:46:06 +00:00
Mateusz Pusz 4912bac0c5 Merge pull request #374 from chiphogg/chiphogg/exp0
Remove `exp` member from `ratio`
2022-07-28 10:39:44 +02:00
Chip Hogg 0adee83866 Use mag_power to make callsites more concise 2022-07-27 14:30:38 +00:00
Mateusz Pusz e7d6b7a9b0 build(conan): Imports reordered to make pre-commit happy 2022-07-26 12:26:47 +02:00
Mateusz Pusz a1d43c2613 chore: Conan 1.X temporary files added to .gitignore 2022-07-26 11:30:38 +02:00
Mateusz Pusz 5dcfa7077e docs: Dependencies chapter updated 2022-07-26 10:02:15 +02:00
Mateusz Pusz 2405c83da1 build(conan): Switched to conan.tools.build.check_min_cppstd 2022-07-26 09:53:26 +02:00
Mateusz Pusz f6332c849f build(conan): self.info.header_only() will be removed in Conan 2.0 2022-07-26 09:38:04 +02:00
Chip Hogg 7e591115fa Remove ratio's numerator() and denominator()
These have now become trivial.
2022-07-20 00:52:37 +00:00
Chip Hogg 7fd6913b73 Replace exp with 0 everywhere, and remove it
This lets us remove a ton of special-casing throughout the codebase, and
just generally makes things a lot simpler.

We also remove the ability to take rational powers of `ratio`, including
`sqrt` and `cbrt` helpers, because these are intrinsically ill-defined.

Fixes #369.
2022-07-20 00:52:37 +00:00
Chip Hogg 6a9dcb30de Migrate explicit-exp inputs 2022-07-20 00:52:36 +00:00
Mateusz Pusz 806ec9ba8c Merge pull request #368 from chiphogg/chiphogg/print-mag
Migrate remaining ratio template parameters to Magnitude
2022-07-19 19:10:06 +02:00
Chip HoggandJohel Ernesto Guerrero Peña fd7b4df29d Add zebi and yobi prefixes
Switching to Magnitude makes these easy.

Co-authored-by: Johel Ernesto Guerrero Peña <johelegp@gmail.com>
2022-07-07 21:02:24 +00:00
Chip Hogg e1a173a02d Migrate prefixes to Magnitude 2022-07-07 17:09:42 +00:00
Chip Hogg 92750072b0 Reimplement ratio_text() as magnitude_text()
The algorithm is exactly the same; we just get our values for
`num_value`, `den_value`, and `exp10` in different ways.

The old printing logic assumed the ratio/Magnitude was an exact rational
number.  Formerly, we couldn't even _represent_ anything else, but with
Magnitude, we can.  Thus, we guard this assumption with a
`static_assert`.  Later on, we can figure out how we want to print
irrational bases and/or rational powers.  The point of this change is to
unblock us from moving to the new infrastructure.
2022-07-07 16:44:19 +00:00
Chip Hogg e1a17ab1f0 Use variables instead of ratio members
This prepares us for a time when we won't _have_ the `ratio` members
(because we'll be using `Magnitude`).
2022-07-07 16:33:51 +00:00
Chip Hogg 407a13c48f Add extract_power_of_10(Magnitude) utility
This will help with pretty-printing magnitudes by extracting a
reasonable power of 10.
2022-07-07 16:10:34 +00:00
Mateusz Pusz 3710b249f3 Merge pull request #355 from chiphogg/chiphogg/switch-to-mag
Use Magnitude instead of ratio in unit implementations
2022-06-16 19:02:22 +02:00
Chip Hogg f004854a9e Remove useful names to appease MSVC 14
Looks like another compiler bug, where it considers a formal parameter
to be "unused" if it isn't used in any `if constexpr` branch.
2022-06-15 21:44:27 +00:00
Chip Hogg 3916b29e53 Move known_first_factor specialization outside namespace 2022-06-15 21:34:45 +00:00
Chip Hogg c8ec771d69 Help factoring for eV/c 2022-06-15 21:19:39 +00:00
Chip Hogg 6d66ac566e Migrate new lumen as well 2022-06-15 21:11:50 +00:00
Chip Hogg ef9e6522ca Merge branch 'master' into chiphogg/switch-to-mag 2022-06-15 20:50:30 +00:00
Mateusz Pusz bd64122880 docs: "Quantity-like Types" chapter added
Refers to #365
2022-06-14 11:18:29 +02:00
Mateusz Pusz f5e6d052ad fix: MSVC compilation error workaround 2022-06-09 13:50:41 +02:00
Mateusz Pusz 9a6d6f9d2a fix: MSVC conversion issues fixed 2022-06-09 13:50:01 +02:00
Mateusz Pusz 955b6a7332 ci: documentation generation fixed after latest Conan breaking changes 2022-06-06 19:57:17 +02:00
Mateusz Pusz c713ae7a43 docs: P0847 reference removed
Resolves #364
2022-06-06 19:09:14 +02:00
Mateusz Pusz a8625d31c6 docs: P0847 reference removed
Resolves #364
2022-06-06 19:05:57 +02:00
Mateusz Pusz 46b3781743 Revert "refactor: 💥 ! " ⋅ " replaced with "⋅" in derived unit symbols"
This reverts commit db09a065ab.
2022-05-24 14:20:17 +02:00
Mateusz Pusz 38fb9911a9 refactor: 💥 ! " ⋅ " replaced with "⋅" in derived unit symbols 2022-05-24 12:56:14 +02:00
Mateusz Pusz db09a065ab refactor: 💥 ! " ⋅ " replaced with "⋅" in derived unit symbols 2022-05-24 12:48:07 +02:00
Mateusz Pusz ef7e7c4cfc refactor: detail::same_scaled_units renamed to detail::compatible_units 2022-05-23 20:47:29 +02:00
Mateusz Pusz 768f400cc3 test: quantity CTAD tests enabled only for the newest compilers 2022-05-23 09:56:45 +02:00
Mateusz Pusz a1637ebac6 feat(example): si_constants example added 2022-05-22 19:51:35 +02:00
Mateusz Pusz 7a368ab3e4 fix: hyperfine_structure_transition_frequency fixed to properly initialize Rep type 2022-05-22 19:50:36 +02:00
Mateusz Pusz 0acfc8aa86 refactor(example): are_derivatives renamed to are_time_derivatives in kalman examples 2022-05-22 19:49:55 +02:00
Mateusz Pusz 4498adce7c test: test for new quantity CTAD guide added 2022-05-22 19:49:10 +02:00
Mateusz Pusz 842f2eaf27 feat: quantity CTAD guide added 2022-05-22 19:47:11 +02:00