{"action":"created","issue":{"url":"https://api.github.com/repos/DRMacIver/hypothesis/issues/187","repository_url":"https://api.github.com/repos/DRMacIver/hypothesis","labels_url":"https://api.github.com/repos/DRMacIver/hypothesis/issues/187/labels{/name}","comments_url":"https://api.github.com/repos/DRMacIver/hypothesis/issues/187/comments","events_url":"https://api.github.com/repos/DRMacIver/hypothesis/issues/187/events","html_url":"https://github.com/DRMacIver/hypothesis/issues/187","id":109615894,"number":187,"title":"Give fractions and decimals min_value and max_value flags","user":{"login":"DRMacIver","id":28623,"avatar_url":"https://avatars.githubusercontent.com/u/28623?v=3","gravatar_id":"","url":"https://api.github.com/users/DRMacIver","html_url":"https://github.com/DRMacIver","followers_url":"https://api.github.com/users/DRMacIver/followers","following_url":"https://api.github.com/users/DRMacIver/following{/other_user}","gists_url":"https://api.github.com/users/DRMacIver/gists{/gist_id}","starred_url":"https://api.github.com/users/DRMacIver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DRMacIver/subscriptions","organizations_url":"https://api.github.com/users/DRMacIver/orgs","repos_url":"https://api.github.com/users/DRMacIver/repos","events_url":"https://api.github.com/users/DRMacIver/events{/privacy}","received_events_url":"https://api.github.com/users/DRMacIver/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/DRMacIver/hypothesis/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/DRMacIver/hypothesis/labels/help-wanted","name":"help-wanted","color":"0052cc"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-10-03T10:16:38Z","updated_at":"2016-02-21T23:56:26Z","closed_at":null,"body":"These mirror the other numeric types (integers, floats).\r\n\r\nNote that this is a harder problem than it sounds because the way they're currently implemented does not make it straightforward at all. \r\n\r\nIt should be pretty feasible to do an exact implementation for fractions but will probably require a custom strategy implementation (it could be done with flatmap, but I would rather it weren't). \r\n\r\nDecimals should just be able to convert its bounds to floats and fractions respectively, pass those through to the underlying stragies, and then filter the end result to deal with any imprecision."},"comment":{"url":"https://api.github.com/repos/DRMacIver/hypothesis/issues/comments/186947807","html_url":"https://github.com/DRMacIver/hypothesis/issues/187#issuecomment-186947807","issue_url":"https://api.github.com/repos/DRMacIver/hypothesis/issues/187","id":186947807,"user":{"login":"mulkieran","id":1218366,"avatar_url":"https://avatars.githubusercontent.com/u/1218366?v=3","gravatar_id":"","url":"https://api.github.com/users/mulkieran","html_url":"https://github.com/mulkieran","followers_url":"https://api.github.com/users/mulkieran/followers","following_url":"https://api.github.com/users/mulkieran/following{/other_user}","gists_url":"https://api.github.com/users/mulkieran/gists{/gist_id}","starred_url":"https://api.github.com/users/mulkieran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mulkieran/subscriptions","organizations_url":"https://api.github.com/users/mulkieran/orgs","repos_url":"https://api.github.com/users/mulkieran/repos","events_url":"https://api.github.com/users/mulkieran/events{/privacy}","received_events_url":"https://api.github.com/users/mulkieran/received_events","type":"User","site_admin":false},"created_at":"2016-02-21T23:56:26Z","updated_at":"2016-02-21T23:56:26Z","body":"It turned out for most of my tests that used fractions() strategy it was necessary to call the ```Fraction.limit_denominator()``` method to get the tests to pass in a reasonable time. This was due to the fact that these tests used an explicit, precise division, with an algorithmic efficiency bounded only by the size of the denominator. So, if I limit the denominator to 100, then I have to do at most 100 divisions before I have calculated the repeating portion of the result. This is at least a hint of what modifiers the strategy should have."}}