-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Added support for binary modifier #4
Conversation
Great, thanks! I have a few comments:
Thanks again, |
Sure. I'll separate them Greg
|
Added support for binary modifier
Merged in with some modifications. In particular I removed 'B' specifier and binu because these have no effect on output when there is no prefix. It is different from hex ('x' & 'X') where letters 'a' - 'f' are used to denote digits and they can be either uppercase or lowercase. Both 'x' & 'X' use the same prefix "0x" so I think having a single prefix for binary ("0b") as well is more consistent. Anyway one can always specify uppercase (or any other) prefix explicitly, e.g. "0B{:b}". I've also removed tests for unsigned long long for now and added more tests for binary formatting. Feel free to submit unsigned long long support (and any other changes) in different pull requests. Thanks, |
Darn, this is not what I was going for. I was going for being as close to C++ streams as possible, where one can do std::cout << std::showbase << std::uppercase << std::hex;Which should have an equivalent as On Thursday, November 14, 2013 8:59 AM, vitaut [email protected] wrote: Merged in with some modifications. |
I don't have anything against having 'B' specifier, but I think this needs to be consistent with 'X'. Currently 'X' uses "0x" prefix and that's one of the reasons I removed 'B' for now. However I tend to agree with you that 'X' should use "0X" prefix and then it makes perfect sense to have 'B' specifier (and binu). |
I don't see that. For me "{:#X}" results in 0X and "{:#x}" results in 0x .. maybe some tests for this would be a good idea, be clearer, and show more examples of formatting. On Thursday, November 14, 2013 11:05 AM, vitaut [email protected] wrote: I don't have anything against having 'B' specifier, but I think this needs to be consistent with 'X'. Currently 'X' uses "0x" prefix and that's one of the reasons I removed 'B' for now. However I tend to agree with you that 'X' should use "0X" prefix and then it makes perfect sense to have 'B' specifier (and binu). |
You are right. I have probably misinterpreted one of the test cases. Adding tests and documentation sounds like a good idea, I've added issue #5 to track this. Will restore 'B' and binu then. |
Great! Thanks. I'll continue sending the pull requests.. it would have been tough to maintain two different branches for the long term. On Thursday, November 14, 2013 12:04 PM, vitaut [email protected] wrote: You are right. I have probably misinterpreted one of the test cases. Adding tests and documentation sounds like a good idea, I've added issue #5 to track this. Will restore 'B' and binu then. |
Add plot functions to variadic-test
Split pull request for bin modifier support