{"action":"created","issue":{"url":"https://api.github.com/repos/numba/numba/issues/427","labels_url":"https://api.github.com/repos/numba/numba/issues/427/labels{/name}","comments_url":"https://api.github.com/repos/numba/numba/issues/427/comments","events_url":"https://api.github.com/repos/numba/numba/issues/427/events","html_url":"https://github.com/numba/numba/issues/427","id":32769027,"number":427,"title":"@numba.jit treats float as integer","user":{"login":"yuyichao","id":712232,"avatar_url":"https://avatars.githubusercontent.com/u/712232?v=3","gravatar_id":"","url":"https://api.github.com/users/yuyichao","html_url":"https://github.com/yuyichao","followers_url":"https://api.github.com/users/yuyichao/followers","following_url":"https://api.github.com/users/yuyichao/following{/other_user}","gists_url":"https://api.github.com/users/yuyichao/gists{/gist_id}","starred_url":"https://api.github.com/users/yuyichao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yuyichao/subscriptions","organizations_url":"https://api.github.com/users/yuyichao/orgs","repos_url":"https://api.github.com/users/yuyichao/repos","events_url":"https://api.github.com/users/yuyichao/events{/privacy}","received_events_url":"https://api.github.com/users/yuyichao/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/numba/numba/labels/0%20-%20Backlog","name":"0 - Backlog","color":"d4c5f9"},{"url":"https://api.github.com/repos/numba/numba/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2014-05-04T14:07:25Z","updated_at":"2015-09-24T17:00:12Z","closed_at":null,"body":"The problem is best described by the following script.\r\n\r\n```python\r\nfrom numba import jit\r\n@jit(nopython=True)\r\ndef f(i):\r\n    return 1 if i else 0\r\nprint(f(0))\r\nprint(f(0.5))\r\nprint(f(1))\r\n@jit(nopython=True)\r\ndef f(i):\r\n    return 1 if i else 0\r\nprint(f(0.5))\r\nprint(f(0))\r\nprint(f(1))\r\nprint(f(0.5))\r\n```\r\nThe expected output is\r\n```\r\n0\r\n1\r\n1\r\n1\r\n0\r\n1\r\n1\r\n```\r\nbut the actual output is\r\n```\r\n0\r\n0\r\n1\r\n1\r\n0\r\n1\r\n1\r\n```\r\nSo it seems that when an integer argument is passed first, numba uses that version and never creates a new version for float input.\r\n\r\nThis behave correctly if `nopython=True` is made impossible (e.g. removing the `nopython=True` and add a `print` in the function `f`) or if the signature `'i8(f8)'` is added to the decorator.\r\n\r\nSystem info:\r\n```\r\nArchLinux ([testing] enabled)\r\npython: 3.4\r\nllvm: 3.4\r\npython-meta: (38 commits after 0.1.2) @ g6136057\r\npython-llvm: (3 commits after 0.12.5 on llvm-3.4 branch) @ g7af2f71\r\npython-llvmmath: (3 commits after 0.1.2) @ g0f4747c\r\npython-numba: current master, 0.13.1\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/numba/numba/issues/comments/142988934","html_url":"https://github.com/numba/numba/issues/427#issuecomment-142988934","issue_url":"https://api.github.com/repos/numba/numba/issues/427","id":142988934,"user":{"login":"ssarangi","id":239816,"avatar_url":"https://avatars.githubusercontent.com/u/239816?v=3","gravatar_id":"","url":"https://api.github.com/users/ssarangi","html_url":"https://github.com/ssarangi","followers_url":"https://api.github.com/users/ssarangi/followers","following_url":"https://api.github.com/users/ssarangi/following{/other_user}","gists_url":"https://api.github.com/users/ssarangi/gists{/gist_id}","starred_url":"https://api.github.com/users/ssarangi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ssarangi/subscriptions","organizations_url":"https://api.github.com/users/ssarangi/orgs","repos_url":"https://api.github.com/users/ssarangi/repos","events_url":"https://api.github.com/users/ssarangi/events{/privacy}","received_events_url":"https://api.github.com/users/ssarangi/received_events","type":"User","site_admin":false},"created_at":"2015-09-24T17:00:12Z","updated_at":"2015-09-24T17:00:12Z","body":"This bug seems to have been fixed in 0.20.0"}}