{"action":"created","issue":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/10393","labels_url":"https://api.github.com/repos/JuliaLang/julia/issues/10393/labels{/name}","comments_url":"https://api.github.com/repos/JuliaLang/julia/issues/10393/comments","events_url":"https://api.github.com/repos/JuliaLang/julia/issues/10393/events","html_url":"https://github.com/JuliaLang/julia/issues/10393","id":59708578,"number":10393,"title":"Floating points and exponentiation","user":{"login":"juliohm","id":3345261,"avatar_url":"https://avatars.githubusercontent.com/u/3345261?v=3","gravatar_id":"","url":"https://api.github.com/users/juliohm","html_url":"https://github.com/juliohm","followers_url":"https://api.github.com/users/juliohm/followers","following_url":"https://api.github.com/users/juliohm/following{/other_user}","gists_url":"https://api.github.com/users/juliohm/gists{/gist_id}","starred_url":"https://api.github.com/users/juliohm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juliohm/subscriptions","organizations_url":"https://api.github.com/users/juliohm/orgs","repos_url":"https://api.github.com/users/juliohm/repos","events_url":"https://api.github.com/users/juliohm/events{/privacy}","received_events_url":"https://api.github.com/users/juliohm/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2015-03-03T21:29:16Z","updated_at":"2015-03-03T23:17:21Z","closed_at":"2015-03-03T22:16:09Z","body":"Consider the following expressions:\r\n\r\n```julia\r\njulia> (1-0.8-0.2)^2\r\n3.0814879110195774e-33\r\n```\r\n```julia\r\njulia> (1-0.8-0.2)^2.5\r\nERROR: DomainError:\r\n\r\n in ^ at math.jl:258\r\n```\r\n\r\nThe approach in MATLAB/Octave is to not fail and instead return a complex:\r\n\r\n```MATLAB\r\noctave> (1-0.8-0.2)^2.5\r\nans =  7.0291e-57 + 2.2959e-41i\r\n```\r\n\r\nWhat is the desired approach in Julia?"},"comment":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/comments/77061087","html_url":"https://github.com/JuliaLang/julia/issues/10393#issuecomment-77061087","issue_url":"https://api.github.com/repos/JuliaLang/julia/issues/10393","id":77061087,"user":{"login":"tkelman","id":5934628,"avatar_url":"https://avatars.githubusercontent.com/u/5934628?v=3","gravatar_id":"","url":"https://api.github.com/users/tkelman","html_url":"https://github.com/tkelman","followers_url":"https://api.github.com/users/tkelman/followers","following_url":"https://api.github.com/users/tkelman/following{/other_user}","gists_url":"https://api.github.com/users/tkelman/gists{/gist_id}","starred_url":"https://api.github.com/users/tkelman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tkelman/subscriptions","organizations_url":"https://api.github.com/users/tkelman/orgs","repos_url":"https://api.github.com/users/tkelman/repos","events_url":"https://api.github.com/users/tkelman/events{/privacy}","received_events_url":"https://api.github.com/users/tkelman/received_events","type":"User","site_admin":false},"created_at":"2015-03-03T23:17:21Z","updated_at":"2015-03-03T23:17:21Z","body":"This has been raised before, not that long ago. DomainErrors can cause issues if you're sending Julia functions as callbacks to C libraries. See https://github.com/mlubin/NaNMath.jl for the simple type-stable approach of returning NaN instead of DomainError for real-valued versions of these functions."}}