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
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
f5e6d052ad
fix: MSVC compilation error workaround
2022-06-09 13:50:41 +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
7a368ab3e4
fix: hyperfine_structure_transition_frequency fixed to properly initialize Rep type
2022-05-22 19:50:36 +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
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
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
0765fb26a2
fix: MSVC complains that an address of NTTP is taken here
2022-05-12 10:55:48 +02:00
Mateusz Pusz
0ed43d3087
fix: restoring original as_magnitude implementation as it was correct
2022-05-11 23:58:30 +02:00
Mateusz Pusz
54489a57b2
refactor: missing constraints on a return type added
...
Implementation verification and interface documentation purposes
2022-05-11 22:56:58 +02:00
Mateusz Pusz
b3afd61b2d
refactor: duplicated concepts checks removed to improve compile times
...
`magnitude` template parameters are already checked during `magnitude` type instantiation.
2022-05-11 22:55:55 +02:00
Mateusz Pusz
104923d1aa
refactor: as_ratio() constrain simplified
2022-05-11 22:52:40 +02:00
Mateusz Pusz
bd5a476bab
fix: pow<> requires a ratio as a template argument
...
Thank you @Nostracodus and @TartanLlama !
2022-05-11 22:52:03 +02:00
Mateusz Pusz
7737167d1d
fix: unit symbol text output unit tests fixed
2022-05-11 18:10:51 +02:00
Mateusz Pusz
5300caf17b
refactor: 💥 ! derived_deduced_unit renamed to derived_scaled_unit
...
Naming is hard ;-)
2022-05-11 12:34:52 +02:00
Mateusz Pusz
32b36fb670
refactor: 💥 ! PrefixFamily support removed
...
It doesn't have much sense to restrict prefixes usage for most units and in many places we were wrong to do so already.
2022-05-11 11:59:33 +02:00
Mateusz Pusz
725d193122
refactor: 💥 ! U::is_named removed from the unit types and replaced with NamedUnit concept
2022-05-11 11:49:14 +02:00
Mateusz Pusz
0522bae972
refactor: 💥 ! unit renamed to derived_unit
2022-05-11 11:40:19 +02:00
Mateusz Pusz
f5d21a0711
refactor: 💥 ! derived_unit renamed to derived_deduced_unit
2022-05-11 11:23:18 +02:00
Mateusz Pusz
8d0b643bb3
refactor: 💥 !named_derived_unit removed as it was not used
2022-05-11 11:10:15 +02:00
Mateusz Pusz
4c60447a28
Merge branch 'master' into downcast_mode_off
2022-05-09 19:12:02 +02:00
Mateusz Pusz
8b52f46bed
fix: fps can now coexist with international system
...
Resolves #347
2022-05-09 14:01:08 +02:00
Mateusz Pusz
a7f1817c9b
feat: SI prefixes allowed for a yard unit as at least kiloyard is used in some domains
2022-05-09 13:59:56 +02:00
Mateusz Pusz
0033319451
fix: shadowing compilation errors on MSVC fixed
2022-05-05 16:12:54 +02:00
Mateusz Pusz
fbc6744bdb
fix: ω, au, and Da allowed to have SI prefixes
...
Relates to #359
2022-04-27 19:33:44 +02:00
Mateusz Pusz
4361cb874e
fix: hectare definition fixed to be a prefixed version of are + other units
...
Relates to #359
2022-04-27 19:32:21 +02:00