Title: Addition/subtraction clear sign from signed 0j · Issue #107854 · python/cpython · GitHub
Open Graph Title: Addition/subtraction clear sign from signed 0j · Issue #107854 · python/cpython
X Title: Addition/subtraction clear sign from signed 0j · Issue #107854 · python/cpython
Description: Complex numbers with signed zero as an imaginary part could be created from a string or with two-argument form of the complex() constructor: >>> complex(1.0, -0.0) (1-0j) >>> complex('(1-0j)') (1-0j) It's also possible to create pure ima...
Open Graph Description: Complex numbers with signed zero as an imaginary part could be created from a string or with two-argument form of the complex() constructor: >>> complex(1.0, -0.0) (1-0j) >>> complex('(1-0j)') (1-0...
X Description: Complex numbers with signed zero as an imaginary part could be created from a string or with two-argument form of the complex() constructor: >>> complex(1.0, -0.0) (1-0j) >>> comp...
Opengraph URL: https://github.com/python/cpython/issues/107854
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Addition/subtraction clear sign from signed 0j","articleBody":"Complex numbers with signed zero as an imaginary part could be created from a string or with two-argument form of the complex() constructor: \r\n```python\r\n\u003e\u003e\u003e complex(1.0, -0.0)\r\n(1-0j)\r\n\u003e\u003e\u003e complex('(1-0j)')\r\n(1-0j)\r\n```\r\nIt's also possible to create pure imaginary numbers with signed zero:\r\n```python\r\n\u003e\u003e\u003e -0j # or it should be complex(0.0,-0.0)?\r\n(-0-0j)\r\n```\r\nBut it's impossible to create a complex number with signed zero as an imaginary part if addition/subtraction is used (i.e. adding a real number and an imaginary number):\r\n```python\r\n\u003e\u003e\u003e 1-0j # should be complex(1.0,-0.0)\r\n(1+0j)\r\n\u003e\u003e\u003e 1+(-0j) # ditto here\r\n(1+0j)\r\n\u003e\u003e\u003e 0-0j # should be complex(0.0,-0.0)\r\n0j\r\n```\r\n","author":{"url":"https://github.com/skirpichev","@type":"Person","name":"skirpichev"},"datePublished":"2023-08-11T03:27:06.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":8},"url":"https://github.com/107854/cpython/issues/107854"}
| 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:3f15703d-8565-9e9a-0434-ea1d3b803fcd |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8A76:BDE76:4D68CD0:6C298BB:6A50F1DC |
| html-safe-nonce | f4db3dc35bb84abaa8b6ce3e153eb50ab96e51c52eaa40fe549bd3d8b240e364 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QTc2OkJERTc2OjRENjhDRDA6NkMyOThCQjo2QTUwRjFEQyIsInZpc2l0b3JfaWQiOiIxMDcwMTExMTkxMTQ0MTMzMDg0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 70c34bba866e40c2867749f1f0668acb1ec3c2e38316dba20e9d51577ccc1862 |
| hovercard-subject-tag | issue:1846142589 |
| 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/python/cpython/107854/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a65ece24682221e2327a84dac53d2f8d3c3c75d44ccea0a811b87cbeef1fc440/python/cpython/issues/107854 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a65ece24682221e2327a84dac53d2f8d3c3c75d44ccea0a811b87cbeef1fc440/python/cpython/issues/107854 |
| og:image:alt | Complex numbers with signed zero as an imaginary part could be created from a string or with two-argument form of the complex() constructor: >>> complex(1.0, -0.0) (1-0j) >>> complex('(1-0j)') (1-0... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | skirpichev |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5266e58c17a510c403505cc811606465e90a881d2007ee7df1c4800d5c659838 |
| 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 |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 5ec60191a48933536a90c8a19f47142fcd0d4739 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width