{"action":"created","issue":{"url":"https://api.github.com/repos/numpy/numpy/issues/6127","labels_url":"https://api.github.com/repos/numpy/numpy/issues/6127/labels{/name}","comments_url":"https://api.github.com/repos/numpy/numpy/issues/6127/comments","events_url":"https://api.github.com/repos/numpy/numpy/issues/6127/events","html_url":"https://github.com/numpy/numpy/issues/6127","id":97802374,"number":6127,"title":"BUG rounding error in divmod","user":{"login":"mhvk","id":2789820,"avatar_url":"https://avatars.githubusercontent.com/u/2789820?v=3","gravatar_id":"","url":"https://api.github.com/users/mhvk","html_url":"https://github.com/mhvk","followers_url":"https://api.github.com/users/mhvk/followers","following_url":"https://api.github.com/users/mhvk/following{/other_user}","gists_url":"https://api.github.com/users/mhvk/gists{/gist_id}","starred_url":"https://api.github.com/users/mhvk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhvk/subscriptions","organizations_url":"https://api.github.com/users/mhvk/orgs","repos_url":"https://api.github.com/users/mhvk/repos","events_url":"https://api.github.com/users/mhvk/events{/privacy}","received_events_url":"https://api.github.com/users/mhvk/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":13,"created_at":"2015-07-28T21:07:22Z","updated_at":"2015-12-30T20:44:39Z","closed_at":null,"body":"The `ndarray` implementation of `divmod` seems to do some incorrect rounding:\r\n```\r\n# regular python\r\ndivmod(78*6e-8, 6e-8)\r\n# (77.0, 5.999999999999965e-08)\r\n# makes sense; cannot represent number precisely as float\r\nimport numpy as np\r\nnp.__version__\r\n# '1.10.0.dev0+00f4fae'\r\ndivmod(np.array(78*6e-8), 6e-8)\r\n# (78.0, 5.9999999999999651e-08)\r\n# Oops!!\r\ndivmod(np.arange(77, 80)*6e-8, 6e-8)\r\n# (array([ 77.,  78.,  79.]),\r\n#   array([  2.24993127e-22,   6.00000000e-08,   6.00000000e-08]))\r\n```"},"comment":{"url":"https://api.github.com/repos/numpy/numpy/issues/comments/168070692","html_url":"https://github.com/numpy/numpy/issues/6127#issuecomment-168070692","issue_url":"https://api.github.com/repos/numpy/numpy/issues/6127","id":168070692,"user":{"login":"anntzer","id":1322974,"avatar_url":"https://avatars.githubusercontent.com/u/1322974?v=3","gravatar_id":"","url":"https://api.github.com/users/anntzer","html_url":"https://github.com/anntzer","followers_url":"https://api.github.com/users/anntzer/followers","following_url":"https://api.github.com/users/anntzer/following{/other_user}","gists_url":"https://api.github.com/users/anntzer/gists{/gist_id}","starred_url":"https://api.github.com/users/anntzer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anntzer/subscriptions","organizations_url":"https://api.github.com/users/anntzer/orgs","repos_url":"https://api.github.com/users/anntzer/repos","events_url":"https://api.github.com/users/anntzer/events{/privacy}","received_events_url":"https://api.github.com/users/anntzer/received_events","type":"User","site_admin":false},"created_at":"2015-12-30T20:44:39Z","updated_at":"2015-12-30T20:44:39Z","body":"Here's a case that's perhaps less contrieved, only using \"non-small\" numbers:\r\n```\r\nIn [3]: divmod(np.float64(1.0), 0.2)\r\nOut[3]: (5.0, 0.19999999999999996) # oops\r\n```"}}