{"action":"created","issue":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/13549","labels_url":"https://api.github.com/repos/JuliaLang/julia/issues/13549/labels{/name}","comments_url":"https://api.github.com/repos/JuliaLang/julia/issues/13549/comments","events_url":"https://api.github.com/repos/JuliaLang/julia/issues/13549/events","html_url":"https://github.com/JuliaLang/julia/issues/13549","id":110853458,"number":13549,"title":"abs behavior incorrect/not documented correctly","user":{"login":"gajjanag","id":6507141,"avatar_url":"https://avatars.githubusercontent.com/u/6507141?v=3","gravatar_id":"","url":"https://api.github.com/users/gajjanag","html_url":"https://github.com/gajjanag","followers_url":"https://api.github.com/users/gajjanag/followers","following_url":"https://api.github.com/users/gajjanag/following{/other_user}","gists_url":"https://api.github.com/users/gajjanag/gists{/gist_id}","starred_url":"https://api.github.com/users/gajjanag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gajjanag/subscriptions","organizations_url":"https://api.github.com/users/gajjanag/orgs","repos_url":"https://api.github.com/users/gajjanag/repos","events_url":"https://api.github.com/users/gajjanag/events{/privacy}","received_events_url":"https://api.github.com/users/gajjanag/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/JuliaLang/julia/labels/doc","name":"doc","color":"02d7e1"},{"url":"https://api.github.com/repos/JuliaLang/julia/labels/intro%20issue","name":"intro issue","color":"0052cc"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":33,"created_at":"2015-10-11T12:35:18Z","updated_at":"2015-10-31T17:20:02Z","closed_at":null,"body":"Currently (at least on 0.3.11, have checked master docs but not implementation), abs does not behave in a mathematically correct manner: abs(typemin(Int)) == typemin(Int) on my Linux x86-64 machine.\r\n\r\nThis problem plagues the C standard library abs(), llabs(), etc as well due to subtle asymmetry in 2's complement arithmetic. The C standard leaves behavior on INT_MIN, etc undefined, and this is fortunately documented, though easily missed by many programs.\r\n\r\nI thus see 2 possible approaches:\r\n1. Follow the C standard behavior, give no guarantee for abs(typemin), and document it.\r\n2. Do something special with typemin, and document it."},"comment":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/comments/152752035","html_url":"https://github.com/JuliaLang/julia/issues/13549#issuecomment-152752035","issue_url":"https://api.github.com/repos/JuliaLang/julia/issues/13549","id":152752035,"user":{"login":"StefanKarpinski","id":153596,"avatar_url":"https://avatars.githubusercontent.com/u/153596?v=3","gravatar_id":"","url":"https://api.github.com/users/StefanKarpinski","html_url":"https://github.com/StefanKarpinski","followers_url":"https://api.github.com/users/StefanKarpinski/followers","following_url":"https://api.github.com/users/StefanKarpinski/following{/other_user}","gists_url":"https://api.github.com/users/StefanKarpinski/gists{/gist_id}","starred_url":"https://api.github.com/users/StefanKarpinski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StefanKarpinski/subscriptions","organizations_url":"https://api.github.com/users/StefanKarpinski/orgs","repos_url":"https://api.github.com/users/StefanKarpinski/repos","events_url":"https://api.github.com/users/StefanKarpinski/events{/privacy}","received_events_url":"https://api.github.com/users/StefanKarpinski/received_events","type":"User","site_admin":false},"created_at":"2015-10-31T17:20:02Z","updated_at":"2015-10-31T17:20:02Z","body":"It's very hard to make something that might raise an exception as fast as a few integer ops, so I wouldn't hold out much hope for making this that much faster."}}