Title: Fix outdated note about 'int' rounding or truncating by mdickinson · Pull Request #102736 · python/cpython · GitHub
Open Graph Title: Fix outdated note about 'int' rounding or truncating by mdickinson · Pull Request #102736 · python/cpython
X Title: Fix outdated note about 'int' rounding or truncating by mdickinson · Pull Request #102736 · python/cpython
Description: This PR fixes an out-of-date note attached to int conversions in stdtypes.rst. The "may round or truncate as in C" language dates from almost 30 years ago, when conversion from a Python float to a Python int involved at C level a (long) cast applied to a C double value. Prior to standard C, presumably the precise behaviour of that cast couldn't be relied upon. But since C89 standardised this behaviour and we can reasonably rely on all current C compilers adhering to that or later standards, the note is out of date. (Moreover, the current code for converting a Python 3 int to a C double is very different.) Related discuss.python.org thread: https://discuss.python.org/t/built-in-types-int-round-or-truncate-please-elaborate/24840
Open Graph Description: This PR fixes an out-of-date note attached to int conversions in stdtypes.rst. The "may round or truncate as in C" language dates from almost 30 years ago, when conversion from a Python f...
X Description: This PR fixes an out-of-date note attached to int conversions in stdtypes.rst. The "may round or truncate as in C" language dates from almost 30 years ago, when conversion from a ...
Opengraph URL: https://github.com/python/cpython/pull/102736
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/checks(.:format) |
| route-controller | pull_requests |
| route-action | checks |
| fetch-nonce | v2:47158484-3b5a-1bd6-458d-0bd12db91075 |
| current-catalog-service-hash | 87dc3bc62d9b466312751bfd5f889726f4f1337bdff4e8be7da7c93d6c00a25a |
| request-id | A86A:3A35C6:1A9AD55:23124CB:696AF30A |
| html-safe-nonce | 47bcfff974e4185ea40420813820055441bc9ca4d1c75f7f72ac8ebef85b4238 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBODZBOjNBMzVDNjoxQTlBRDU1OjIzMTI0Q0I6Njk2QUYzMEEiLCJ2aXNpdG9yX2lkIjoiNjI0MTkyMDEyMTAxNDI1MjI5OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | a86dc6ae9fc6b3b6b1dafc4aa1b396792c33760b3d41a7c8b500372d24425c95 |
| hovercard-subject-tag | pull_request:1277226872 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,checks,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/python/cpython/pull/102736/checks |
| twitter:image | https://avatars.githubusercontent.com/u/662003?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/662003?s=400&v=4 |
| og:image:alt | This PR fixes an out-of-date note attached to int conversions in stdtypes.rst. The "may round or truncate as in C" language dates from almost 30 years ago, when conversion from a Python f... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5f99f7c1d70f01da5b93e5ca90303359738944d8ab470e396496262c66e60b8d |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive full-width full-width-p-0 |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 82560a55c6b2054555076f46e683151ee28a19bc |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width