-
Notifications
You must be signed in to change notification settings - Fork 94
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
Optimize text output for scaled units #652
Comments
Could you give a simple example to illustrate? I think the issue would read a lot better with an example. |
Sure! Sorry, I should've done it right away, but due to the lack of time, I just made a short note for myself. Here are some examples: std::cout << 10 * (mag<100> * km) << "\n";
std::court << (10 * (mag<100> * km)).unit << "\n";
std::cout << 10 * (mag_ratio<1, 18000> * (m/s)) << "\n";
std::cout << 10 * (mag_ratio<1, 18000> * m/s) << "\n";
std::cout << 10 * km/h + 5 * m/s << "\n";
std::cout << 10 * L_per_100km << "\n"; Now:
Better:
To summarize:
Please let me know your thoughts. |
Personally, I'm partial to square brackets, and I'm partial to always having them be present. I think Admittedly, As for the optimizations you mention, I think this would boil down to gathering all numeric scale factors into a single common one. In Au at least, this was really easy to get working locally, but I haven't put it out for review because I'm not sure I like the implications. Some seem clearly better, while others are a little bit worse --- for example, we'd lose the ability to have |
In my humble opinion: |
LEWGI's feedback was that we already have too many formatting options. They continue to describe this as a debug text output, and for debugging, we do not have to support everything. They already suggested removing some of the options, but I have provided some pushback so far. |
Same for me my friend :/ |
Sorry, what was the same for you? I didn't understand what you were referring to. |
Parenthesis for scaled units is needed only when more than one unit is used in the symbol of a derived unit. Otherwise, such grouping is not necessary. To make it clear where the runtime part of the quantity ends and the compile time unit symbol begins, an
x
separator can be used.The text was updated successfully, but these errors were encountered: