{"action":"created","issue":{"url":"https://api.github.com/repos/andrenth/ocaml-stdint/issues/8","repository_url":"https://api.github.com/repos/andrenth/ocaml-stdint","labels_url":"https://api.github.com/repos/andrenth/ocaml-stdint/issues/8/labels{/name}","comments_url":"https://api.github.com/repos/andrenth/ocaml-stdint/issues/8/comments","events_url":"https://api.github.com/repos/andrenth/ocaml-stdint/issues/8/events","html_url":"https://github.com/andrenth/ocaml-stdint/issues/8","id":158534208,"number":8,"title":"Some conversions are incorrect","user":{"login":"hcarty","id":199147,"avatar_url":"https://avatars.githubusercontent.com/u/199147?v=3","gravatar_id":"","url":"https://api.github.com/users/hcarty","html_url":"https://github.com/hcarty","followers_url":"https://api.github.com/users/hcarty/followers","following_url":"https://api.github.com/users/hcarty/following{/other_user}","gists_url":"https://api.github.com/users/hcarty/gists{/gist_id}","starred_url":"https://api.github.com/users/hcarty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hcarty/subscriptions","organizations_url":"https://api.github.com/users/hcarty/orgs","repos_url":"https://api.github.com/users/hcarty/repos","events_url":"https://api.github.com/users/hcarty/events{/privacy}","received_events_url":"https://api.github.com/users/hcarty/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-06-05T02:34:52Z","updated_at":"2016-07-20T12:14:26Z","closed_at":null,"body":"On a 64bit OCaml 4.02.3, latest stdint from opam:\r\n\r\n```ocaml\r\n(* Testing in the toplevel *)\r\n# Stdint.Uint32.to_int @@ Stdint.Uint32.of_int 0xFFFFFFFF;;\r\n- : int = -1\r\n```\r\n\r\nbut I would have expected `4294967295`.\r\n\r\nThe conversion to `Int64.t` does work properly:\r\n```ocaml\r\n# Stdint.Uint32.to_int64 @@ Stdint.Uint32.of_int 0xFFFFFFFF;;\r\n- : int64 = 4294967295L\r\n```"},"comment":{"url":"https://api.github.com/repos/andrenth/ocaml-stdint/issues/comments/233931937","html_url":"https://github.com/andrenth/ocaml-stdint/issues/8#issuecomment-233931937","issue_url":"https://api.github.com/repos/andrenth/ocaml-stdint/issues/8","id":233931937,"user":{"login":"andrenth","id":30213,"avatar_url":"https://avatars.githubusercontent.com/u/30213?v=3","gravatar_id":"","url":"https://api.github.com/users/andrenth","html_url":"https://github.com/andrenth","followers_url":"https://api.github.com/users/andrenth/followers","following_url":"https://api.github.com/users/andrenth/following{/other_user}","gists_url":"https://api.github.com/users/andrenth/gists{/gist_id}","starred_url":"https://api.github.com/users/andrenth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrenth/subscriptions","organizations_url":"https://api.github.com/users/andrenth/orgs","repos_url":"https://api.github.com/users/andrenth/repos","events_url":"https://api.github.com/users/andrenth/events{/privacy}","received_events_url":"https://api.github.com/users/andrenth/received_events","type":"User","site_admin":false},"created_at":"2016-07-20T12:14:26Z","updated_at":"2016-07-20T12:14:26Z","body":"I'm not really sure to be honest. Current behavior mirrors C:\r\n\r\n```C\r\nint\r\nmain() {\r\n    int x = 0xFFFFFFFF;\r\n    printf(\"%d, %ld\\n\", (int)((uint32_t)x), (int64_t)((uint32_t)x)); // -1, 4294967295\r\n}\r\n```"}}
{"actor":{"display_login":"andrenth"}}