Title: Converting numpy float64 of python float to Decimal is not the same (get rounded in numpy case) · Issue #1833 · pythonnet/pythonnet · GitHub
Open Graph Title: Converting numpy float64 of python float to Decimal is not the same (get rounded in numpy case) · Issue #1833 · pythonnet/pythonnet
X Title: Converting numpy float64 of python float to Decimal is not the same (get rounded in numpy case) · Issue #1833 · pythonnet/pythonnet
Description: Environment Pythonnet version: '2.5.1' Python version: 3.8.12 Operating System: Win10 .NET Runtime: 4.8.4470.0 numpy version: 1.21.4 Details Describe what you were trying to get done. I had to convert floats to Decimal but somehow the cu...
Open Graph Description: Environment Pythonnet version: '2.5.1' Python version: 3.8.12 Operating System: Win10 .NET Runtime: 4.8.4470.0 numpy version: 1.21.4 Details Describe what you were trying to get done. I had to conv...
X Description: Environment Pythonnet version: '2.5.1' Python version: 3.8.12 Operating System: Win10 .NET Runtime: 4.8.4470.0 numpy version: 1.21.4 Details Describe what you were trying to get done. I had...
Opengraph URL: https://github.com/pythonnet/pythonnet/issues/1833
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Converting numpy float64 of python float to Decimal is not the same (get rounded in numpy case)","articleBody":"### Environment\r\n\r\n- Pythonnet version: '2.5.1'\r\n- Python version: 3.8.12\r\n- Operating System: Win10\r\n- .NET Runtime: 4.8.4470.0\r\n- numpy version: 1.21.4\r\n\r\n### Details\r\n\r\n- Describe what you were trying to get done.\r\n\r\n I had to convert floats to Decimal but somehow the current Double I got out of Decimal when looking at it using ToDouble would give me only the round part of the double. I figured that my floats were not native python but numpy float64 . This issue happens only with numpy floats..\r\n\r\n- What commands did you run to trigger this issue? If you can provide a\r\n [Minimal, Complete, and Verifiable example](http://stackoverflow.com/help/mcve)\r\n this will help us understand the issue.\r\n\r\n```python\r\n import clr\r\n from System import Decimal\r\n import numpy as np\r\n\r\n d= 45.5\r\n assert d == np.array([d])[0] # should be fine\r\n assert Decimal(d) == Decimal(np.array([d])[0]) # assertion error \r\n \r\n```\r\n","author":{"url":"https://github.com/seb5g","@type":"Person","name":"seb5g"},"datePublished":"2022-06-24T18:00:37.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/1833/pythonnet/issues/1833"}
| 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:6e3e0635-5c75-b6fe-9e95-4439dff08297 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C70A:3AB938:2DB66E:3C307A:69702DAC |
| html-safe-nonce | d8d1a5debc144d4fa6d78eb262347fa2b2627b87f28677fffd2009d0316f1007 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNzBBOjNBQjkzODoyREI2NkU6M0MzMDdBOjY5NzAyREFDIiwidmlzaXRvcl9pZCI6Ijc0NzE2MTUzMjk5NzM1NzkxODEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 4a1538866257d927dc24a53b7383acb45a5905b342ca39d7aa3b8aa90aac495a |
| hovercard-subject-tag | issue:1284031429 |
| 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/pythonnet/pythonnet/1833/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a17da886d3dd7ecea9a5859742f61ec577f8f21d24897d49e5e4c2932a1b87b8/pythonnet/pythonnet/issues/1833 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a17da886d3dd7ecea9a5859742f61ec577f8f21d24897d49e5e4c2932a1b87b8/pythonnet/pythonnet/issues/1833 |
| og:image:alt | Environment Pythonnet version: '2.5.1' Python version: 3.8.12 Operating System: Win10 .NET Runtime: 4.8.4470.0 numpy version: 1.21.4 Details Describe what you were trying to get done. I had to conv... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | seb5g |
| hostname | github.com |
| expected-hostname | github.com |
| None | 01fa379f5de85ef8e791d09724e69709ce9eb9595278316e0a921312dc88e0bc |
| turbo-cache-control | no-preview |
| go-import | github.com/pythonnet/pythonnet git https://github.com/pythonnet/pythonnet.git |
| octolytics-dimension-user_id | 6050430 |
| octolytics-dimension-user_login | pythonnet |
| octolytics-dimension-repository_id | 14748123 |
| octolytics-dimension-repository_nwo | pythonnet/pythonnet |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 14748123 |
| octolytics-dimension-repository_network_root_nwo | pythonnet/pythonnet |
| 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 | dda91974c069382b0dfa47b2da7e28bd061c8331 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width