{"action":"created","comment":{"url":"https://api.github.com/repos/net-fundamentals-2017/homework/pulls/comments/150186073","pull_request_review_id":75699161,"id":150186073,"diff_hunk":"@@ -0,0 +1,216 @@\n+﻿using System;\r\n+using System.Diagnostics;\r\n+using System.Threading;\r\n+using System.Collections.Generic;\r\n+using System.Linq;\r\n+using System.Text;\r\n+using System.Threading.Tasks;\r\n+\r\n+namespace Task_4\r\n+{\r\n+    public static class DoubleExtension\r\n+    {\r\n+        private static string ToBinInt(int x)\r\n+        {\r\n+            StringBuilder sb = new StringBuilder();\r\n+\r\n+            while (x > 0)\r\n+            {\r\n+                sb.Append(x % 2);\r\n+                x /= 2;\r\n+            }\r\n+\r\n+            char[] array = sb.ToString().ToCharArray();\r\n+            Array.Reverse(array);\r\n+            string s = new string(array);\r\n+\r\n+            return s;\r\n+        }\r\n+\r\n+        private static string ToBinFrac(double x, int len)\r\n+        {\r\n+            StringBuilder sb = new StringBuilder();\r\n+            int a;\r\n+            int i = 0;\r\n+\r\n+            while (i < len)\r\n+            {\r\n+                x *= 2;\r\n+                a = (int)Math.Truncate(x);\r\n+                sb.Append(a);\r\n+                x -= a;\r\n+                i++;\r\n+            }\r\n+\r\n+            return sb.ToString();\r\n+        }\r\n+\r\n+        public static string ToBinary(this double value)\r\n+        {\r\n+            if (value == 0)\r\n+                return new string('0', 16);\r\n+\r\n+            const int orderSize = 11;\r\n+            const int mantissaSize = 52;\r\n+            const int shift = 1023;\r\n+\r\n+            int intOfDouble = (int)Math.Truncate(Math.Abs(value));\r\n+            double fracOfDouble = Math.Abs(value) - intOfDouble;\r\n+\r\n+            string intOfDoubleBin = ToBinInt(intOfDouble);\r","path":"Task_4/Task_4/Program.cs","position":60,"original_position":60,"commit_id":"0fce8c9089161a4fcc94463a8d26ac873de15f66","original_commit_id":"0fce8c9089161a4fcc94463a8d26ac873de15f66","user":{"login":"Andead","id":22258361,"avatar_url":"https://avatars1.githubusercontent.com/u/22258361?v=4","gravatar_id":"","url":"https://api.github.com/users/Andead","html_url":"https://github.com/Andead","followers_url":"https://api.github.com/users/Andead/followers","following_url":"https://api.github.com/users/Andead/following{/other_user}","gists_url":"https://api.github.com/users/Andead/gists{/gist_id}","starred_url":"https://api.github.com/users/Andead/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Andead/subscriptions","organizations_url":"https://api.github.com/users/Andead/orgs","repos_url":"https://api.github.com/users/Andead/repos","events_url":"https://api.github.com/users/Andead/events{/privacy}","received_events_url":"https://api.github.com/users/Andead/received_events","type":"User","site_admin":false},"body":"Take a look at `string Convert.ToString(int value, int toBase)` method of the standard library.","created_at":"2017-11-10T09:22:02Z","updated_at":"2017-11-10T09:31:28Z","html_url":"https://github.com/net-fundamentals-2017/homework/pull/53#discussion_r150186073","pull_request_url":"https://api.github.com/repos/net-fundamentals-2017/homework/pulls/53","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/net-fundamentals-2017/homework/pulls/comments/150186073"},"html":{"href":"https://github.com/net-fundamentals-2017/homework/pull/53#discussion_r150186073"},"pull_request":{"href":"https://api.github.com/repos/net-fundamentals-2017/homework/pulls/53"}}},"pull_request":{"url":"https://api.github.com/repos/net-fundamentals-2017/homework/pulls/53","id":151604841,"html_url":"https://github.com/net-fundamentals-2017/homework/pull/53","diff_url":"https://github.com/net-fundamentals-2017/homework/pull/53.diff","patch_url":"https://github.com/net-fundamentals-2017/homework/pull/53.patch","issue_url":"https://api.github.com/repos/net-fundamentals-2017/homework/issues/53","number":53,"state":"open","locked":false,"title":"Homework 4","user":{"login":"rpetrukhin","id":33234344,"avatar_url":"https://avatars0.githubusercontent.com/u/33234344?v=4","gravatar_id":"","url":"https://api.github.com/users/rpetrukhin","html_url":"https://github.com/rpetrukhin","followers_url":"https://api.github.com/users/rpetrukhin/followers","following_url":"https://api.github.com/users/rpetrukhin/following{/other_user}","gists_url":"https://api.github.com/users/rpetrukhin/gists{/gist_id}","starred_url":"https://api.github.com/users/rpetrukhin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rpetrukhin/subscriptions","organizations_url":"https://api.github.com/users/rpetrukhin/orgs","repos_url":"https://api.github.com/users/rpetrukhin/repos","events_url":"https://api.github.com/users/rpetrukhin/events{/privacy}","received_events_url":"https://api.github.com/users/rpetrukhin/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-11-09T09:53:55Z","updated_at":"2017-11-10T09:31:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"74848533adba2e3f84db7edbd0d0b379f7b77150","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/net-fundamentals-2017/homework/pulls/53/commits","review_comments_url":"https://api.github.com/repos/net-fundamentals-2017/homework/pulls/53/comments","review_comment_url":"https://api.github.com/repos/net-fundamentals-2017/homework/pulls/comments{/number}","comments_url":"https://api.github.com/repos/net-fundamentals-2017/homework/issues/53/comments","statuses_url":"https://api.github.com/repos/net-fundamentals-2017/homework/statuses/0fce8c9089161a4fcc94463a8d26ac873de15f66","head":{"label":"rpetrukhin:Ruslan-Petrukhin","ref":"Ruslan-Petrukhin","sha":"0fce8c9089161a4fcc94463a8d26ac873de15f66","user":{"login":"rpetrukhin","id":33234344,"avatar_url":"https://avatars0.githubusercontent.com/u/33234344?v=4","gravatar_id":"","url":"https://api.github.com/users/rpetrukhin","html_url":"https://github.com/rpetrukhin","followers_url":"https://api.github.com/users/rpetrukhin/followers","following_url":"https://api.github.com/users/rpetrukhin/following{/other_user}","gists_url":"https://api.github.com/users/rpetrukhin/gists{/gist_id}","starred_url":"https://api.github.com/users/rpetrukhin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rpetrukhin/subscriptions","organizations_url":"https://api.github.com/users/rpetrukhin/orgs","repos_url":"https://api.github.com/users/rpetrukhin/repos","events_url":"https://api.github.com/users/rpetrukhin/events{/privacy}","received_events_url":"https://api.github.com/users/rpetrukhin/received_events","type":"User","site_admin":false},"repo":{"id":108994291,"name":"homework","full_name":"rpetrukhin/homework","owner":{"login":"rpetrukhin","id":33234344,"avatar_url":"https://avatars0.githubusercontent.com/u/33234344?v=4","gravatar_id":"","url":"https://api.github.com/users/rpetrukhin","html_url":"https://github.com/rpetrukhin","followers_url":"https://api.github.com/users/rpetrukhin/followers","following_url":"https://api.github.com/users/rpetrukhin/following{/other_user}","gists_url":"https://api.github.com/users/rpetrukhin/gists{/gist_id}","starred_url":"https://api.github.com/users/rpetrukhin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rpetrukhin/subscriptions","organizations_url":"https://api.github.com/users/rpetrukhin/orgs","repos_url":"https://api.github.com/users/rpetrukhin/repos","events_url":"https://api.github.com/users/rpetrukhin/events{/privacy}","received_events_url":"https://api.github.com/users/rpetrukhin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rpetrukhin/homework","description":"This is where you submit your homework","fork":true,"url":"https://api.github.com/repos/rpetrukhin/homework","forks_url":"https://api.github.com/repos/rpetrukhin/homework/forks","keys_url":"https://api.github.com/repos/rpetrukhin/homework/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rpetrukhin/homework/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rpetrukhin/homework/teams","hooks_url":"https://api.github.com/repos/rpetrukhin/homework/hooks","issue_events_url":"https://api.github.com/repos/rpetrukhin/homework/issues/events{/number}","events_url":"https://api.github.com/repos/rpetrukhin/homework/events","assignees_url":"https://api.github.com/repos/rpetrukhin/homework/assignees{/user}","branches_url":"https://api.github.com/repos/rpetrukhin/homework/branches{/branch}","tags_url":"https://api.github.com/repos/rpetrukhin/homework/tags","blobs_url":"https://api.github.com/repos/rpetrukhin/homework/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rpetrukhin/homework/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rpetrukhin/homework/git/refs{/sha}","trees_url":"https://api.github.com/repos/rpetrukhin/homework/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rpetrukhin/homework/statuses/{sha}","languages_url":"https://api.github.com/repos/rpetrukhin/homework/languages","stargazers_url":"https://api.github.com/repos/rpetrukhin/homework/stargazers","contributors_url":"https://api.github.com/repos/rpetrukhin/homework/contributors","subscribers_url":"https://api.github.com/repos/rpetrukhin/homework/subscribers","subscription_url":"https://api.github.com/repos/rpetrukhin/homework/subscription","commits_url":"https://api.github.com/repos/rpetrukhin/homework/commits{/sha}","git_commits_url":"https://api.github.com/repos/rpetrukhin/homework/git/commits{/sha}","comments_url":"https://api.github.com/repos/rpetrukhin/homework/comments{/number}","issue_comment_url":"https://api.github.com/repos/rpetrukhin/homework/issues/comments{/number}","contents_url":"https://api.github.com/repos/rpetrukhin/homework/contents/{+path}","compare_url":"https://api.github.com/repos/rpetrukhin/homework/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rpetrukhin/homework/merges","archive_url":"https://api.github.com/repos/rpetrukhin/homework/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rpetrukhin/homework/downloads","issues_url":"https://api.github.com/repos/rpetrukhin/homework/issues{/number}","pulls_url":"https://api.github.com/repos/rpetrukhin/homework/pulls{/number}","milestones_url":"https://api.github.com/repos/rpetrukhin/homework/milestones{/number}","notifications_url":"https://api.github.com/repos/rpetrukhin/homework/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rpetrukhin/homework/labels{/name}","releases_url":"https://api.github.com/repos/rpetrukhin/homework/releases{/id}","deployments_url":"https://api.github.com/repos/rpetrukhin/homework/deployments","created_at":"2017-10-31T12:44:33Z","updated_at":"2017-10-30T13:15:12Z","pushed_at":"2017-11-09T09:52:03Z","git_url":"git://github.com/rpetrukhin/homework.git","ssh_url":"git@github.com:rpetrukhin/homework.git","clone_url":"https://github.com/rpetrukhin/homework.git","svn_url":"https://github.com/rpetrukhin/homework","homepage":"https://netfundamentals.slack.com","size":386,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"net-fundamentals-2017:Ruslan-Petrukhin","ref":"Ruslan-Petrukhin","sha":"3f995b642e3d49fda570f7282deb5c1424a03786","user":{"login":"net-fundamentals-2017","id":33220926,"avatar_url":"https://avatars2.githubusercontent.com/u/33220926?v=4","gravatar_id":"","url":"https://api.github.com/users/net-fundamentals-2017","html_url":"https://github.com/net-fundamentals-2017","followers_url":"https://api.github.com/users/net-fundamentals-2017/followers","following_url":"https://api.github.com/users/net-fundamentals-2017/following{/other_user}","gists_url":"https://api.github.com/users/net-fundamentals-2017/gists{/gist_id}","starred_url":"https://api.github.com/users/net-fundamentals-2017/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/net-fundamentals-2017/subscriptions","organizations_url":"https://api.github.com/users/net-fundamentals-2017/orgs","repos_url":"https://api.github.com/users/net-fundamentals-2017/repos","events_url":"https://api.github.com/users/net-fundamentals-2017/events{/privacy}","received_events_url":"https://api.github.com/users/net-fundamentals-2017/received_events","type":"Organization","site_admin":false},"repo":{"id":108837450,"name":"homework","full_name":"net-fundamentals-2017/homework","owner":{"login":"net-fundamentals-2017","id":33220926,"avatar_url":"https://avatars2.githubusercontent.com/u/33220926?v=4","gravatar_id":"","url":"https://api.github.com/users/net-fundamentals-2017","html_url":"https://github.com/net-fundamentals-2017","followers_url":"https://api.github.com/users/net-fundamentals-2017/followers","following_url":"https://api.github.com/users/net-fundamentals-2017/following{/other_user}","gists_url":"https://api.github.com/users/net-fundamentals-2017/gists{/gist_id}","starred_url":"https://api.github.com/users/net-fundamentals-2017/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/net-fundamentals-2017/subscriptions","organizations_url":"https://api.github.com/users/net-fundamentals-2017/orgs","repos_url":"https://api.github.com/users/net-fundamentals-2017/repos","events_url":"https://api.github.com/users/net-fundamentals-2017/events{/privacy}","received_events_url":"https://api.github.com/users/net-fundamentals-2017/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/net-fundamentals-2017/homework","description":"This is where you submit your homework","fork":false,"url":"https://api.github.com/repos/net-fundamentals-2017/homework","forks_url":"https://api.github.com/repos/net-fundamentals-2017/homework/forks","keys_url":"https://api.github.com/repos/net-fundamentals-2017/homework/keys{/key_id}","collaborators_url":"https://api.github.com/repos/net-fundamentals-2017/homework/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/net-fundamentals-2017/homework/teams","hooks_url":"https://api.github.com/repos/net-fundamentals-2017/homework/hooks","issue_events_url":"https://api.github.com/repos/net-fundamentals-2017/homework/issues/events{/number}","events_url":"https://api.github.com/repos/net-fundamentals-2017/homework/events","assignees_url":"https://api.github.com/repos/net-fundamentals-2017/homework/assignees{/user}","branches_url":"https://api.github.com/repos/net-fundamentals-2017/homework/branches{/branch}","tags_url":"https://api.github.com/repos/net-fundamentals-2017/homework/tags","blobs_url":"https://api.github.com/repos/net-fundamentals-2017/homework/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/net-fundamentals-2017/homework/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/net-fundamentals-2017/homework/git/refs{/sha}","trees_url":"https://api.github.com/repos/net-fundamentals-2017/homework/git/trees{/sha}","statuses_url":"https://api.github.com/repos/net-fundamentals-2017/homework/statuses/{sha}","languages_url":"https://api.github.com/repos/net-fundamentals-2017/homework/languages","stargazers_url":"https://api.github.com/repos/net-fundamentals-2017/homework/stargazers","contributors_url":"https://api.github.com/repos/net-fundamentals-2017/homework/contributors","subscribers_url":"https://api.github.com/repos/net-fundamentals-2017/homework/subscribers","subscription_url":"https://api.github.com/repos/net-fundamentals-2017/homework/subscription","commits_url":"https://api.github.com/repos/net-fundamentals-2017/homework/commits{/sha}","git_commits_url":"https://api.github.com/repos/net-fundamentals-2017/homework/git/commits{/sha}","comments_url":"https://api.github.com/repos/net-fundamentals-2017/homework/comments{/number}","issue_comment_url":"https://api.github.com/repos/net-fundamentals-2017/homework/issues/comments{/number}","contents_url":"https://api.github.com/repos/net-fundamentals-2017/homework/contents/{+path}","compare_url":"https://api.github.com/repos/net-fundamentals-2017/homework/compare/{base}...{head}","merges_url":"https://api.github.com/repos/net-fundamentals-2017/homework/merges","archive_url":"https://api.github.com/repos/net-fundamentals-2017/homework/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/net-fundamentals-2017/homework/downloads","issues_url":"https://api.github.com/repos/net-fundamentals-2017/homework/issues{/number}","pulls_url":"https://api.github.com/repos/net-fundamentals-2017/homework/pulls{/number}","milestones_url":"https://api.github.com/repos/net-fundamentals-2017/homework/milestones{/number}","notifications_url":"https://api.github.com/repos/net-fundamentals-2017/homework/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/net-fundamentals-2017/homework/labels{/name}","releases_url":"https://api.github.com/repos/net-fundamentals-2017/homework/releases{/id}","deployments_url":"https://api.github.com/repos/net-fundamentals-2017/homework/deployments","created_at":"2017-10-30T10:47:17Z","updated_at":"2017-11-03T11:59:17Z","pushed_at":"2017-11-10T09:25:10Z","git_url":"git://github.com/net-fundamentals-2017/homework.git","ssh_url":"git@github.com:net-fundamentals-2017/homework.git","clone_url":"https://github.com/net-fundamentals-2017/homework.git","svn_url":"https://github.com/net-fundamentals-2017/homework","homepage":"https://netfundamentals.slack.com","size":3901,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":4,"mirror_url":null,"archived":false,"open_issues_count":11,"forks":4,"open_issues":11,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/net-fundamentals-2017/homework/pulls/53"},"html":{"href":"https://github.com/net-fundamentals-2017/homework/pull/53"},"issue":{"href":"https://api.github.com/repos/net-fundamentals-2017/homework/issues/53"},"comments":{"href":"https://api.github.com/repos/net-fundamentals-2017/homework/issues/53/comments"},"review_comments":{"href":"https://api.github.com/repos/net-fundamentals-2017/homework/pulls/53/comments"},"review_comment":{"href":"https://api.github.com/repos/net-fundamentals-2017/homework/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/net-fundamentals-2017/homework/pulls/53/commits"},"statuses":{"href":"https://api.github.com/repos/net-fundamentals-2017/homework/statuses/0fce8c9089161a4fcc94463a8d26ac873de15f66"}},"author_association":"NONE"}}
{"actor":{"display_login":"Andead"}}