{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/7317","labels_url":"https://api.github.com/repos/dotnet/roslyn/issues/7317/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/roslyn/issues/7317/comments","events_url":"https://api.github.com/repos/dotnet/roslyn/issues/7317/events","html_url":"https://github.com/dotnet/roslyn/pull/7317","id":120901097,"number":7317,"title":"Constant-folding should not use excess precision.","user":{"login":"gafter","id":3804346,"avatar_url":"https://avatars.githubusercontent.com/u/3804346?v=3","gravatar_id":"","url":"https://api.github.com/users/gafter","html_url":"https://github.com/gafter","followers_url":"https://api.github.com/users/gafter/followers","following_url":"https://api.github.com/users/gafter/following{/other_user}","gists_url":"https://api.github.com/users/gafter/gists{/gist_id}","starred_url":"https://api.github.com/users/gafter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gafter/subscriptions","organizations_url":"https://api.github.com/users/gafter/orgs","repos_url":"https://api.github.com/users/gafter/repos","events_url":"https://api.github.com/users/gafter/events{/privacy}","received_events_url":"https://api.github.com/users/gafter/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/dotnet/roslyn/labels/4%20-%20In%20Review","name":"4 - In Review","color":"CCCCCC"},{"url":"https://api.github.com/repos/dotnet/roslyn/labels/Area-Compilers","name":"Area-Compilers","color":"5319e7"},{"url":"https://api.github.com/repos/dotnet/roslyn/labels/Bug","name":"Bug","color":"fc2929"}],"state":"open","locked":false,"assignee":{"login":"gafter","id":3804346,"avatar_url":"https://avatars.githubusercontent.com/u/3804346?v=3","gravatar_id":"","url":"https://api.github.com/users/gafter","html_url":"https://github.com/gafter","followers_url":"https://api.github.com/users/gafter/followers","following_url":"https://api.github.com/users/gafter/following{/other_user}","gists_url":"https://api.github.com/users/gafter/gists{/gist_id}","starred_url":"https://api.github.com/users/gafter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gafter/subscriptions","organizations_url":"https://api.github.com/users/gafter/orgs","repos_url":"https://api.github.com/users/gafter/repos","events_url":"https://api.github.com/users/gafter/events{/privacy}","received_events_url":"https://api.github.com/users/gafter/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/dotnet/roslyn/milestones/4","html_url":"https://github.com/dotnet/roslyn/milestones/1.2","labels_url":"https://api.github.com/repos/dotnet/roslyn/milestones/4/labels","id":937402,"number":4,"title":"1.2","description":"This is our 1.2 Milestone.\r\n\r\n<!---\r\n@huboard:{\"order\":2.0}\r\n-->\r\n","creator":{"login":"jaredpar","id":146967,"avatar_url":"https://avatars.githubusercontent.com/u/146967?v=3","gravatar_id":"","url":"https://api.github.com/users/jaredpar","html_url":"https://github.com/jaredpar","followers_url":"https://api.github.com/users/jaredpar/followers","following_url":"https://api.github.com/users/jaredpar/following{/other_user}","gists_url":"https://api.github.com/users/jaredpar/gists{/gist_id}","starred_url":"https://api.github.com/users/jaredpar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaredpar/subscriptions","organizations_url":"https://api.github.com/users/jaredpar/orgs","repos_url":"https://api.github.com/users/jaredpar/repos","events_url":"https://api.github.com/users/jaredpar/events{/privacy}","received_events_url":"https://api.github.com/users/jaredpar/received_events","type":"User","site_admin":false},"open_issues":589,"closed_issues":245,"state":"open","created_at":"2015-01-15T20:48:55Z","updated_at":"2015-12-14T18:34:22Z","due_on":null,"closed_at":null},"comments":6,"created_at":"2015-12-08T00:24:06Z","updated_at":"2015-12-14T18:39:54Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/dotnet/roslyn/pulls/7317","html_url":"https://github.com/dotnet/roslyn/pull/7317","diff_url":"https://github.com/dotnet/roslyn/pull/7317.diff","patch_url":"https://github.com/dotnet/roslyn/pull/7317.patch"},"body":"Fixes #7262 \r\n\r\nThe Roslyn C# compiler stores constants of type `System.Single` (i.e. `float`) internally as type `double`, but without truncating the value to the required precision. Also, it computes binary constant-folded operators incorrectly, essentially computing the operation in double precision. It also ignores explicit casts to `float`, as those are considered identity conversions, but the language spec required that we truncate precision when we see such a cast.\r\n\r\nThis change causes floating-point constant-folding operations to be done in precisely the proper precision, and causes casts to truncate precision. With the first change, the latter change may turn out to be a no-op (when the value is already a float, it should already have the correct value with the correct precision), but I'm doing it for completeness.\r\n\r\n@dotnet/roslyn-compiler Please review."},"comment":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/comments/164521280","html_url":"https://github.com/dotnet/roslyn/pull/7317#issuecomment-164521280","issue_url":"https://api.github.com/repos/dotnet/roslyn/issues/7317","id":164521280,"user":{"login":"TyOverby","id":573215,"avatar_url":"https://avatars.githubusercontent.com/u/573215?v=3","gravatar_id":"","url":"https://api.github.com/users/TyOverby","html_url":"https://github.com/TyOverby","followers_url":"https://api.github.com/users/TyOverby/followers","following_url":"https://api.github.com/users/TyOverby/following{/other_user}","gists_url":"https://api.github.com/users/TyOverby/gists{/gist_id}","starred_url":"https://api.github.com/users/TyOverby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TyOverby/subscriptions","organizations_url":"https://api.github.com/users/TyOverby/orgs","repos_url":"https://api.github.com/users/TyOverby/repos","events_url":"https://api.github.com/users/TyOverby/events{/privacy}","received_events_url":"https://api.github.com/users/TyOverby/received_events","type":"User","site_admin":false},"created_at":"2015-12-14T18:39:54Z","updated_at":"2015-12-14T18:39:54Z","body":"LGTM"}}