-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Format general Magnitudes in printed output #386
Comments
I agree with the points above. The units should be printed in terms of powers of 10 rather than a power of 2 and 5. This is connected to #377, and actually, after the refactoring of the type also to be the power of 10, the printing part should be trivial. |
Both FMT and ostream approach should be checked. At least ostreams will fail to compile for pi-based units as they use |
Also, the printing of units like |
Or, to be fair, similar to what Au wishes that it does. 😅 (aurora-opensource/au#85) |
I've just implemented everything besides:
Here are the unit tests: mp-units/test/static/unit_symbol_test.cpp Lines 113 to 188 in dba8b07
Please let me know it this is what you meant. |
This is a terrific and industry-leading solution. (At least for C++; I don't know the state of the art elsewhere.) There are maybe a few cases where I'm not completely sure what I'd like to see printed, like how it switches from And, I shudder to think what we'll see for radical magnitudes, or for magnitudes that overflow Awesome change! |
mp-units/src/core/include/mp-units/framework/magnitude.h Lines 560 to 578 in a95b2c7
|
Now that we are using
Magnitude
, notratio
, we need to decide how a Magnitude should be printed, and then implement that policy. We'll need to take into account, among perhaps other considerations:I don't know what the policy should be, but step one is to figure that out, and step two is to implement it.
(I don't have time right now to work on this, but I thought it important to have an issue to track the pending work and provide a home for discussion.)
The text was updated successfully, but these errors were encountered: