Title: correct representation of the maximum possible float64 · Issue #5471 · RustPython/RustPython · GitHub
Open Graph Title: correct representation of the maximum possible float64 · Issue #5471 · RustPython/RustPython
X Title: correct representation of the maximum possible float64 · Issue #5471 · RustPython/RustPython
Description: Feature Correct representation of the maximum possible float64. When I run the following code in RustPython, it gives an "inf", but in CPython it gives the correct maximum possible float64. I ran into this on Wikifunctions (documented he...
Open Graph Description: Feature Correct representation of the maximum possible float64. When I run the following code in RustPython, it gives an "inf", but in CPython it gives the correct maximum possible float64. I ran i...
X Description: Feature Correct representation of the maximum possible float64. When I run the following code in RustPython, it gives an "inf", but in CPython it gives the correct maximum possible float6...
Opengraph URL: https://github.com/RustPython/RustPython/issues/5471
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"correct representation of the maximum possible float64","articleBody":"## Feature\r\nCorrect representation of the maximum possible float64.\r\n\r\nWhen I run the following code in RustPython, it gives an \"inf\", but in CPython it gives the correct maximum possible float64. I ran into this on Wikifunctions (documented here https://www.wikifunctions.org/wiki/Talk:Z21420) where we use RustPython and are trying to correctly implement a new data type for float64.\r\n\r\n```\r\nexponent = int(\"1023\")\r\nsignificand = int(\"4503599627370495\")\r\nmantissa = 1 + significand/2**52\r\npositive = 1\r\nimport math\r\nval = math.ldexp(mantissa/2.0, exponent+1) * (1 if positive else -1)\r\nprint(str(val))\r\n```","author":{"url":"https://github.com/99of9","@type":"Person","name":"99of9"},"datePublished":"2025-01-09T08:36:45.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/5471/RustPython/issues/5471"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:19056058-0ffe-2a67-fdbb-e8402f4f4248 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E692:63833:49158D:5F0F1A:696B41D9 |
| html-safe-nonce | 7079816924d337165d6c0fbac537e84500b88ea3c90460ed4f8c39fefac73309 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNjkyOjYzODMzOjQ5MTU4RDo1RjBGMUE6Njk2QjQxRDkiLCJ2aXNpdG9yX2lkIjoiNjY5NzM1MTQ2MDg3NTM1NDU4NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 9d4e428ddafdfef59a82b59c31923cdde6d6b33e5c1a66c0976429818bbd004e |
| hovercard-subject-tag | issue:2777170824 |
| github-keyboard-shortcuts | repository,issues,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/_view_fragments/issues/show/RustPython/RustPython/5471/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ec64f22487c2dd789f296f854413ba71baa5b0927f5f8d9b472e5b6bfa1e4862/RustPython/RustPython/issues/5471 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ec64f22487c2dd789f296f854413ba71baa5b0927f5f8d9b472e5b6bfa1e4862/RustPython/RustPython/issues/5471 |
| og:image:alt | Feature Correct representation of the maximum possible float64. When I run the following code in RustPython, it gives an "inf", but in CPython it gives the correct maximum possible float64. I ran i... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | 99of9 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5f99f7c1d70f01da5b93e5ca90303359738944d8ab470e396496262c66e60b8d |
| turbo-cache-control | no-preview |
| go-import | github.com/RustPython/RustPython git https://github.com/RustPython/RustPython.git |
| octolytics-dimension-user_id | 39710557 |
| octolytics-dimension-user_login | RustPython |
| octolytics-dimension-repository_id | 135201145 |
| octolytics-dimension-repository_nwo | RustPython/RustPython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 135201145 |
| octolytics-dimension-repository_network_root_nwo | RustPython/RustPython |
| turbo-body-classes | logged-out env-production page-responsive |
| 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