Commit Graph
264 Commits
Author SHA1 Message Date
Mateusz Pusz d2e49b25f7 Clang uses the Ranges-v3 concepts 2020-03-17 17:12:01 +01:00
rbrugo c88dc6904b Reused specs field instead of precision and type 2020-03-17 14:08:13 +01:00
rbrugo 0593516622 Added types in format grammar 2020-03-17 14:08:13 +01:00
Mateusz Pusz c26f4500e1 E and O format specifiers removed and A added 2020-03-16 11:31:02 +01:00
Mateusz Pusz 30232186f1 Bitrate UDLs refactored 2020-03-10 21:12:00 +01:00
Mateusz Pusz 6a5f25750d UDL naming refactored 2020-03-10 20:53:53 +01:00
Mateusz Pusz 5f73123f87 Contrained on a named unit added to a prefixed_unit 2020-03-09 18:56:55 +01:00
Mateusz Pusz 5a72983c47 Removed an old TODO comment 2020-03-01 14:50:01 +01:00
Mateusz Pusz cd0eb11c14 standard_gravity constant added 2020-03-01 13:11:15 +01:00
Mateusz Pusz 736a8bd3c8 "clang-format off" removed for base_dimension_less 2020-02-25 11:55:16 +01:00
Mateusz Pusz 0c02f94d29 Printing of uknown non-coherent units fixed 2020-02-24 20:45:47 +01:00
Mateusz Pusz 1f63fdb945 Printing of a space separator for unitless quantites disabled 2020-02-24 20:01:57 +01:00
Mateusz Pusz c73ba84ad3 Natural Units support added 2020-02-24 19:15:46 +01:00
Mateusz Pusz e7756bf4eb Printing order of base units according to the recipe fixed 2020-02-24 15:18:37 +01:00
Mateusz Pusz 0eb2f404be clang-format applied to type_list 2020-02-24 15:17:03 +01:00
Mateusz Pusz c745bebffd type_list_join added 2020-02-24 15:15:46 +01:00
Mateusz Pusz a0a18f35ac Momentum support added 2020-02-23 17:40:01 +01:00
Oliver Schönrock fe998e1eab better sqrt_impl
MUCH bigger range (although still not quitre max -- see comments)
no recursion
make this example possible: https://godbolt.org/z/tDFkfR
2020-02-23 17:29:28 +01:00
Oliver Schönrock d4492524d1 use assert. static can't work 2020-02-23 17:29:28 +01:00
Oliver Schönrock ef862c9f69 include what we use and use system header syntax
don't show 10^0 when den != 0
2020-02-22 22:08:36 +01:00
Oliver Schönrock 424f0512c1 hack fix?! 2020-02-22 22:08:36 +01:00
Mateusz Pusz 0c89df3980 unknown_unit renamed to unknown_coherent_unit 2020-02-22 09:37:40 +01:00
Mateusz Pusz d51a9eac28 Physical constants refactored 2020-02-21 10:57:57 +01:00
Oliver Schönrock 834d1fa09d extending the range of operator* for incoherent units with large num/den
this improves the situation for #55 (doesn't solve it outright)
motivating examples which now work are:
1q_mi * 1q_mi * 1q_mi
1q_au * 1q_au
tests added and docs updated
2020-02-20 23:46:55 +01:00
Mateusz Pusz 395a98c055 WrappedUnit support added 2020-02-20 20:16:05 +01:00
Oliver Schönrock 39a2c2de0e employing more mathemtaically correct ratio_gcd calc (for common ratio)
really finds the maximum common ration as opposed to previous algo which
simplified on the exp part of the ratio by using std::min
most of new code credit to Conor Williams
discussion and additional doc here:
https://github.com/mpusz/units/issues/62#issuecomment-588152833
test case was 1yd + 1in = 37in => added as a test
commenting out unusued ratio_add and its tests
if to be reintroduced, should also use the new gcd routines
additonal change was required to check in `safe_divisible` concept
den=1 is not sufficient anymore. reusing new gcd routines
moved ratio nomalize and new gcd routines into new, separate bits/ratio_maths.h
this resolves #62
2020-02-20 19:59:12 +01:00
Mateusz Pusz 18620044c5 All UDLs are now prefixed with q_ 2020-02-17 15:56:06 +01:00
Oliver Schönrock 0566cc631d implementing units::ratio_add and tests
not yet used in src/include/units/bits/dim_consolidate.h
because it breaks and cascades (due to new exponent we think)
2020-02-16 14:53:06 +01:00
Oliver Schönrock 291d3d1eb7 dealing with exponent during sqrt
fixes #58
2020-02-16 14:53:06 +01:00
Mateusz Pusz d832b3a462 basic_fixed_string op== improved 2020-02-12 09:55:28 +01:00
Mateusz Pusz 172fa74239 gigaelectronvolt added 2020-02-12 09:50:07 +01:00
Mateusz Pusz 3be8ee921e Starship improvements after the latest gcc fixes 2020-02-12 09:48:04 +01:00
Mateusz Pusz c3cfd3acaa SI fundamental constants added 2020-02-11 23:57:04 +01:00
Mateusz Pusz f8b1c8d8a2 Initial constants support added 2020-02-11 23:55:02 +01:00
Mateusz Pusz 4ec015d26e SI prefix enabled for eV 2020-02-11 20:58:18 +01:00
Mateusz Pusz 2360392a3d Tests for #58 added (uncomment when fixed) 2020-02-11 08:51:34 +01:00
Mateusz Pusz 037503cbc6 deduced_unit fixed + unit test for mass unit added 2020-02-10 20:35:32 +01:00
Mateusz Pusz 78350ed94b same_as remplaced with is_same_v in if constexpr 2020-02-08 20:11:20 +01:00
Mateusz Pusz 0d319675f8 prefix definition simplified 2020-02-08 19:49:36 +01:00
Mateusz Pusz 518c52cda1 Base unit for SI mass fixed 2020-02-02 15:37:51 +01:00
Mateusz Pusz 0354c56ac2 clang-format applied to a downcasting header 2020-01-31 17:03:35 +01:00
Mateusz Pusz 645570ff57 Library updated to the latest cmake common tools 2020-01-31 17:02:27 +01:00
Mateusz Pusz b27a422076 Preeliminary clang support added 2020-01-28 08:37:43 +01:00
Mateusz Pusz 1c4624303e Whitespace cleanup 2020-01-14 12:23:32 +01:00
Mateusz Pusz 1c857868bb Some length unit fixed + whitespace cleanup 2020-01-14 12:23:06 +01:00
Andy Little 024f5a9c83 change const order
move in,ft,fathom,ft2,ft3,mph from us to international namespace
TODO distinguish units with different names for same values
2020-01-12 21:34:36 +01:00
Andy Little c93136e81b physical/si/density : change UDL from kg_per_m3 to kgpm3 (and then fix example/box_example) 2020-01-12 21:34:36 +01:00
Andy Little 283e9d81a3 Split the various non-si length units into their own namespaces.
new namespaces are
international ( combination of us and imperial + Canada etc)
iau  (https://www.iau.org/
imperial ( old imperial units)
typographical ( for sizes of printing fonts etc)

These namespace are based on some research , mainly on wikipedia.
Look in src/include/units/physical/si/length.h to see links to see the references to documentation justifying the change.

Unfortunately there are 3 foot units for example, an old imperial version, an old us version and an international version, which is more recent and attempts to unify the two previous ones. All versions have slight changes in value, so I opted to use the international version
The main change in the layout is that inch,foot and yard have been moved from us to international.

With this modification, I also modified the physical/us/area.hpp, volume.hpp and volume.hpp headers to refer to the international units.
This may not be correct, but if the modified us::foot (rather than international foot is used as a basis for these units, then
there is a ratio integer overflow during compilation, probably due to taking 3rd power of a ratio. After this commit. I will try to show that on another branch.
2020-01-12 21:34:36 +01:00
Andy Little 868842bd46 Third party examples : add box example
Add si::density quantity header .
Add si::resistance quantity header.
Update si::capacitance header with mF, uF, nF, pF.
Update si::voltage header with mV, uV, nV,pV
Third party example : add capacitor time curve example
Add incoherent length units, TODO  move them out from si header.
Third party examples : add clcpp_response showing effectivenes of typed units for physical quantity library
Third party examples : add conversion factor example
Add third party examples to cmake

Third party examples : box example : Add air_density constant for clarity remove explicit this-> and tidy up.
Third party examples : in clcpp response example, change base unit from km to m for single type or all units example.
Third party examples : conversion_factor , add inline constexpr to units_str function.
Third party examples : box_example, change quantity::unit syntax to quantity::unit<> to allow generic(default double) value_type.
examples : remove examples from third party to main examples directory. Update cmake.
physical/si/resistance.hpp : remove underscores from kiloohm etc, UDL collision with 'R' so prefix with underscore
2020-01-12 21:34:36 +01:00
Mateusz Pusz a01c811f5f Square and cubic UDLs renamed 2020-01-09 10:03:41 +01:00