- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 33.3k
gh-113804: Support formatting floats in hexadecimal notation #113805
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
Changes from 22 commits
64ab5ed
              024b02d
              005577c
              97134b9
              e05059f
              b73515f
              7d47aef
              025de36
              8739f6b
              7525d1a
              19e5083
              faed5f3
              01b490e
              322a011
              9621d36
              e721305
              7c04f82
              e78b85c
              d973c7a
              4940336
              d1ff85e
              089afe4
              be84c10
              c98b092
              e089ff5
              795d1da
              58e84fd
              728671a
              4eaa4f8
              File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | 
|---|---|---|
|  | @@ -55,6 +55,8 @@ extern PyObject* _Py_string_to_number_with_underscores( | |
|  | ||
| extern double _Py_parse_inf_or_nan(const char *p, char **endptr); | ||
|  | ||
| extern char * _Py_dg_dtoa_hex(double x, int precision, int always_add_sign, | ||
|          | ||
| int use_alt_formatting, int upper, int float_hex); | ||
|  | ||
| #ifdef __cplusplus | ||
| } | ||
|  | ||
| Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| Support formatting floats (using "x" and "X" format types) in hexadecimal | ||
| notation, like ``0x1.2efp-2``. Patch by Sergey B Kirpichev. | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that digits can be upper or lower cases:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hexadecimal digits can:) I thought this was obvious from the context, so "hexadecimal" was omitted (doesn't fit to one line). I can add this.
I worry that in your version it might be not clear, that uppercase used not just for the prefix.