{"action":"created","issue":{"url":"https://api.github.com/repos/micropython/micropython/issues/1033","labels_url":"https://api.github.com/repos/micropython/micropython/issues/1033/labels{/name}","comments_url":"https://api.github.com/repos/micropython/micropython/issues/1033/comments","events_url":"https://api.github.com/repos/micropython/micropython/issues/1033/events","html_url":"https://github.com/micropython/micropython/pull/1033","id":53251030,"number":1033,"title":"py: Fix float to int conversion for large exponents.","user":{"login":"doogle","id":1585181,"avatar_url":"https://avatars.githubusercontent.com/u/1585181?v=3","gravatar_id":"","url":"https://api.github.com/users/doogle","html_url":"https://github.com/doogle","followers_url":"https://api.github.com/users/doogle/followers","following_url":"https://api.github.com/users/doogle/following{/other_user}","gists_url":"https://api.github.com/users/doogle/gists{/gist_id}","starred_url":"https://api.github.com/users/doogle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/doogle/subscriptions","organizations_url":"https://api.github.com/users/doogle/orgs","repos_url":"https://api.github.com/users/doogle/repos","events_url":"https://api.github.com/users/doogle/events{/privacy}","received_events_url":"https://api.github.com/users/doogle/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-01-02T12:47:36Z","updated_at":"2015-01-03T11:41:53Z","closed_at":"2015-01-02T22:34:59Z","pull_request":{"url":"https://api.github.com/repos/micropython/micropython/pulls/1033","html_url":"https://github.com/micropython/micropython/pull/1033","diff_url":"https://github.com/micropython/micropython/pull/1033.diff","patch_url":"https://github.com/micropython/micropython/pull/1033.patch"},"body":"To address issue #1009, I've implemented a mpz_set_from_float() that works for any size exponent, to add to the work done in 12033df511a5a5f0237a764379aacfbceb6c45dd.\r\nI've tested it under x86 Linux with all 4 combinations of single/double precision floats, and 16-bit/32-bit mpz digits.\r\nInf/NaN handling might not be as desired."},"comment":{"url":"https://api.github.com/repos/micropython/micropython/issues/comments/68592206","html_url":"https://github.com/micropython/micropython/pull/1033#issuecomment-68592206","issue_url":"https://api.github.com/repos/micropython/micropython/issues/1033","id":68592206,"user":{"login":"pfalcon","id":500451,"avatar_url":"https://avatars.githubusercontent.com/u/500451?v=3","gravatar_id":"","url":"https://api.github.com/users/pfalcon","html_url":"https://github.com/pfalcon","followers_url":"https://api.github.com/users/pfalcon/followers","following_url":"https://api.github.com/users/pfalcon/following{/other_user}","gists_url":"https://api.github.com/users/pfalcon/gists{/gist_id}","starred_url":"https://api.github.com/users/pfalcon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pfalcon/subscriptions","organizations_url":"https://api.github.com/users/pfalcon/orgs","repos_url":"https://api.github.com/users/pfalcon/repos","events_url":"https://api.github.com/users/pfalcon/events{/privacy}","received_events_url":"https://api.github.com/users/pfalcon/received_events","type":"User","site_admin":false},"created_at":"2015-01-03T11:41:53Z","updated_at":"2015-01-03T11:41:53Z","body":"> Do you know of any other formats that may be in use?\r\n\r\nWell, it's more about abstract portability - no matter what's the underlying floating point format, as long as it's accompanied by frexp(), and there's integer type with more bits than mantissa, float can be converted to integer constituents.\r\n\r\nAs for specific examples, there're surely 8087-style FP80, quad floats. Older ARMs used to use mixed-endianness doubles: http://en.wikipedia.org/wiki/Endianness#Floating-point_and_endianness . None of those cases is relevant so far of course.\r\n\r\nThanks for the patch, closing #1009.\r\n"}}