{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rust/issues/21888","labels_url":"https://api.github.com/repos/rust-lang/rust/issues/21888/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/21888/comments","events_url":"https://api.github.com/repos/rust-lang/rust/issues/21888/events","html_url":"https://github.com/rust-lang/rust/pull/21888","id":56348717,"number":21888,"title":"Improved assert_approx_eq!() + doc","user":{"login":"dhardy","id":134893,"avatar_url":"https://avatars.githubusercontent.com/u/134893?v=3","gravatar_id":"","url":"https://api.github.com/users/dhardy","html_url":"https://github.com/dhardy","followers_url":"https://api.github.com/users/dhardy/followers","following_url":"https://api.github.com/users/dhardy/following{/other_user}","gists_url":"https://api.github.com/users/dhardy/gists{/gist_id}","starred_url":"https://api.github.com/users/dhardy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dhardy/subscriptions","organizations_url":"https://api.github.com/users/dhardy/orgs","repos_url":"https://api.github.com/users/dhardy/repos","events_url":"https://api.github.com/users/dhardy/events{/privacy}","received_events_url":"https://api.github.com/users/dhardy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"alexcrichton","id":64996,"avatar_url":"https://avatars.githubusercontent.com/u/64996?v=3","gravatar_id":"","url":"https://api.github.com/users/alexcrichton","html_url":"https://github.com/alexcrichton","followers_url":"https://api.github.com/users/alexcrichton/followers","following_url":"https://api.github.com/users/alexcrichton/following{/other_user}","gists_url":"https://api.github.com/users/alexcrichton/gists{/gist_id}","starred_url":"https://api.github.com/users/alexcrichton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexcrichton/subscriptions","organizations_url":"https://api.github.com/users/alexcrichton/orgs","repos_url":"https://api.github.com/users/alexcrichton/repos","events_url":"https://api.github.com/users/alexcrichton/events{/privacy}","received_events_url":"https://api.github.com/users/alexcrichton/received_events","type":"User","site_admin":false},"milestone":null,"comments":8,"created_at":"2015-02-03T08:40:22Z","updated_at":"2015-02-12T05:10:11Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/rust-lang/rust/pulls/21888","html_url":"https://github.com/rust-lang/rust/pull/21888","diff_url":"https://github.com/rust-lang/rust/pull/21888.diff","patch_url":"https://github.com/rust-lang/rust/pull/21888.patch"},"body":"This pull request is to:\r\n*   adjust assert_approx_eq!() to a form which has worked well for me in other unit tests\r\n*   add documentation and export the macro\r\n\r\nQuestion: does the intention need further discussion (elsewhere)?\r\n\r\nQuestion: what other changes are needed? E.g. also adjust `libcore/num/float_macros.rs`, moving to `libstd/macros.rs`?\r\n\r\nPossible extension: a `assert_approx_tol!()` version taking two tolerance arguments (to replace uses of `1e-6`)."},"comment":{"url":"https://api.github.com/repos/rust-lang/rust/issues/comments/74018668","html_url":"https://github.com/rust-lang/rust/pull/21888#issuecomment-74018668","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/21888","id":74018668,"user":{"login":"huonw","id":1203825,"avatar_url":"https://avatars.githubusercontent.com/u/1203825?v=3","gravatar_id":"","url":"https://api.github.com/users/huonw","html_url":"https://github.com/huonw","followers_url":"https://api.github.com/users/huonw/followers","following_url":"https://api.github.com/users/huonw/following{/other_user}","gists_url":"https://api.github.com/users/huonw/gists{/gist_id}","starred_url":"https://api.github.com/users/huonw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/huonw/subscriptions","organizations_url":"https://api.github.com/users/huonw/orgs","repos_url":"https://api.github.com/users/huonw/repos","events_url":"https://api.github.com/users/huonw/events{/privacy}","received_events_url":"https://api.github.com/users/huonw/received_events","type":"User","site_admin":false},"created_at":"2015-02-12T05:10:11Z","updated_at":"2015-02-12T05:10:11Z","body":"@mdinger how \"approximate\" is `~=`? And what sort of approximate? At least with an `assert_approx_eq` macro/function it could take a precision argument, and even an argument specifying whether to use relative or absolute distance."}}