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 Hogg and Johel 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
Mateusz Pusz
49eb4523cd
refactor: units:: namespace prefix is no longer needed before prefix
2022-05-21 18:56:47 +02:00
Mateusz Pusz
09a0c35cf3
docs: src/include directory does not exist anymore
...
Resolves #363
2022-05-18 15:57:29 +02:00
Mateusz Pusz
e5565c7d04
docs: typo in the CHANGELOG fixed
2022-05-14 11:29:23 +02:00
Mateusz Pusz
43844c484c
fix: UNITS_MSVC_WORKAROUND() fixed for other compilers
2022-05-14 11:27:12 +02:00
Mateusz Pusz
b559a5f98f
fix: explicit ratio creation added as a workaround for MSVC
2022-05-14 11:24:00 +02:00
Mateusz Pusz
6c1062e166
fix: UNITS_MSVC_WORKAROUND() added
2022-05-14 11:22:09 +02:00
Mateusz Pusz
a2a50622a4
style: test_package/conanfile.py reformatted to make pre-commit happy
2022-05-13 18:35:25 +02:00
Mateusz Pusz
4a09edfcbf
feat: luminous_efficacy SI defining constant support added
2022-05-13 14:32:57 +02:00
Mateusz Pusz
13f03bfe70
feat: luminous_flux support added
2022-05-13 14:31:13 +02:00
Mateusz Pusz
10f8254cc8
style: si.h includes order fixed
2022-05-13 09:56:58 +02:00
Chip Hogg
86b81c9384
Undo misguided fix attempt
2022-05-12 21:53:51 +00:00
Chip Hogg
2bdc778ab6
Constrain template
2022-05-12 18:19:20 +00:00
Chip Hogg
f36205f08d
Capture NTTP in variable
...
This should make it OK for MSVC to take the address, working around a
compiler bug.
2022-05-12 18:17:35 +00:00
Chip Hogg
88a69cecd8
Try fixing build
...
Unfortunately, my local build hangs, so I can't tell whether this works.
2022-05-12 18:02:47 +00:00
Chip Hogg
a0ac140a19
Merge fixes into branch after updating with upstream changes
2022-05-12 16:54:48 +00:00
Chip Hogg
59fa420272
Fix remaining builds/tests
2022-05-12 16:52:05 +00:00
Chip Hogg
5fb468697b
Merge branch 'master' into chiphogg/switch-to-mag
2022-05-12 16:12:01 +00:00
Mateusz Pusz
8c0f9d4f8e
build: test_package/conanfile.py updated for Conan 2.0
2022-05-12 17:12:35 +02:00
Mateusz Pusz
1f6f5817ae
docs: CHANGELOG.md updated
2022-05-12 17:12:00 +02:00