{"action":"created","comment":{"url":"https://api.github.com/repos/cockroachdb/cockroach/pulls/comments/39547215","id":39547215,"diff_hunk":"@@ -761,3 +773,73 @@ func datumToRawString(datum Datum) (string, error) {\n \n \treturn \"\", fmt.Errorf(\"argument type unsupported: %s\", datum.Type())\n }\n+\n+// Round rounds x to n digits.\n+// Directly taken from CPython's `double_round` in\n+// cpython/Object/floatobject.c.","path":"sql/parser/builtins.go","position":28,"original_position":28,"commit_id":"f5178034657d4dc91b5ea3864998b4370dc11444","original_commit_id":"f5178034657d4dc91b5ea3864998b4370dc11444","user":{"login":"bdarnell","id":160562,"avatar_url":"https://avatars.githubusercontent.com/u/160562?v=3","gravatar_id":"","url":"https://api.github.com/users/bdarnell","html_url":"https://github.com/bdarnell","followers_url":"https://api.github.com/users/bdarnell/followers","following_url":"https://api.github.com/users/bdarnell/following{/other_user}","gists_url":"https://api.github.com/users/bdarnell/gists{/gist_id}","starred_url":"https://api.github.com/users/bdarnell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bdarnell/subscriptions","organizations_url":"https://api.github.com/users/bdarnell/orgs","repos_url":"https://api.github.com/users/bdarnell/repos","events_url":"https://api.github.com/users/bdarnell/events{/privacy}","received_events_url":"https://api.github.com/users/bdarnell/received_events","type":"User","site_admin":false},"body":"Make this a URL: https://hg.python.org/cpython/file/v3.5.0/Objects/floatobject.c#l863","created_at":"2015-09-15T18:29:05Z","updated_at":"2015-09-15T18:29:05Z","html_url":"https://github.com/cockroachdb/cockroach/pull/2512#discussion_r39547215","pull_request_url":"https://api.github.com/repos/cockroachdb/cockroach/pulls/2512","_links":{"self":{"href":"https://api.github.com/repos/cockroachdb/cockroach/pulls/comments/39547215"},"html":{"href":"https://github.com/cockroachdb/cockroach/pull/2512#discussion_r39547215"},"pull_request":{"href":"https://api.github.com/repos/cockroachdb/cockroach/pulls/2512"}}},"pull_request":{"url":"https://api.github.com/repos/cockroachdb/cockroach/pulls/2512","id":45082453,"html_url":"https://github.com/cockroachdb/cockroach/pull/2512","diff_url":"https://github.com/cockroachdb/cockroach/pull/2512.diff","patch_url":"https://github.com/cockroachdb/cockroach/pull/2512.patch","issue_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/2512","number":2512,"state":"open","locked":false,"title":"[RFC] Add round to math builtins.","user":{"login":"thschroeter","id":40804,"avatar_url":"https://avatars.githubusercontent.com/u/40804?v=3","gravatar_id":"","url":"https://api.github.com/users/thschroeter","html_url":"https://github.com/thschroeter","followers_url":"https://api.github.com/users/thschroeter/followers","following_url":"https://api.github.com/users/thschroeter/following{/other_user}","gists_url":"https://api.github.com/users/thschroeter/gists{/gist_id}","starred_url":"https://api.github.com/users/thschroeter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thschroeter/subscriptions","organizations_url":"https://api.github.com/users/thschroeter/orgs","repos_url":"https://api.github.com/users/thschroeter/repos","events_url":"https://api.github.com/users/thschroeter/events{/privacy}","received_events_url":"https://api.github.com/users/thschroeter/received_events","type":"User","site_admin":false},"body":"Implementation of round taken from CPython.  It returns\r\n`NaN` if overflow is detected.\r\n\r\nNeeds tests and better understanding of the algorithm.\r\n\r\nThis implementation is about 6x faster than the\r\nFormatFloat / ParseFloat implementatation.\r\n\r\nBenchmarkRound1-8\t 3000000\t        576 ns/op\r\nBenchmarkRound2-8\t20000000         95.9 ns/op","created_at":"2015-09-15T18:08:19Z","updated_at":"2015-09-15T18:29:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5bb9cff1949b5af05e39eadc7f18e87410caf658","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/cockroachdb/cockroach/pulls/2512/commits","review_comments_url":"https://api.github.com/repos/cockroachdb/cockroach/pulls/2512/comments","review_comment_url":"https://api.github.com/repos/cockroachdb/cockroach/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/2512/comments","statuses_url":"https://api.github.com/repos/cockroachdb/cockroach/statuses/f5178034657d4dc91b5ea3864998b4370dc11444","head":{"label":"thschroeter:round","ref":"round","sha":"f5178034657d4dc91b5ea3864998b4370dc11444","user":{"login":"thschroeter","id":40804,"avatar_url":"https://avatars.githubusercontent.com/u/40804?v=3","gravatar_id":"","url":"https://api.github.com/users/thschroeter","html_url":"https://github.com/thschroeter","followers_url":"https://api.github.com/users/thschroeter/followers","following_url":"https://api.github.com/users/thschroeter/following{/other_user}","gists_url":"https://api.github.com/users/thschroeter/gists{/gist_id}","starred_url":"https://api.github.com/users/thschroeter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thschroeter/subscriptions","organizations_url":"https://api.github.com/users/thschroeter/orgs","repos_url":"https://api.github.com/users/thschroeter/repos","events_url":"https://api.github.com/users/thschroeter/events{/privacy}","received_events_url":"https://api.github.com/users/thschroeter/received_events","type":"User","site_admin":false},"repo":{"id":29617637,"name":"cockroach","full_name":"thschroeter/cockroach","owner":{"login":"thschroeter","id":40804,"avatar_url":"https://avatars.githubusercontent.com/u/40804?v=3","gravatar_id":"","url":"https://api.github.com/users/thschroeter","html_url":"https://github.com/thschroeter","followers_url":"https://api.github.com/users/thschroeter/followers","following_url":"https://api.github.com/users/thschroeter/following{/other_user}","gists_url":"https://api.github.com/users/thschroeter/gists{/gist_id}","starred_url":"https://api.github.com/users/thschroeter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thschroeter/subscriptions","organizations_url":"https://api.github.com/users/thschroeter/orgs","repos_url":"https://api.github.com/users/thschroeter/repos","events_url":"https://api.github.com/users/thschroeter/events{/privacy}","received_events_url":"https://api.github.com/users/thschroeter/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/thschroeter/cockroach","description":"A Scalable, Geo-Replicated, Transactional Datastore","fork":true,"url":"https://api.github.com/repos/thschroeter/cockroach","forks_url":"https://api.github.com/repos/thschroeter/cockroach/forks","keys_url":"https://api.github.com/repos/thschroeter/cockroach/keys{/key_id}","collaborators_url":"https://api.github.com/repos/thschroeter/cockroach/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/thschroeter/cockroach/teams","hooks_url":"https://api.github.com/repos/thschroeter/cockroach/hooks","issue_events_url":"https://api.github.com/repos/thschroeter/cockroach/issues/events{/number}","events_url":"https://api.github.com/repos/thschroeter/cockroach/events","assignees_url":"https://api.github.com/repos/thschroeter/cockroach/assignees{/user}","branches_url":"https://api.github.com/repos/thschroeter/cockroach/branches{/branch}","tags_url":"https://api.github.com/repos/thschroeter/cockroach/tags","blobs_url":"https://api.github.com/repos/thschroeter/cockroach/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/thschroeter/cockroach/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/thschroeter/cockroach/git/refs{/sha}","trees_url":"https://api.github.com/repos/thschroeter/cockroach/git/trees{/sha}","statuses_url":"https://api.github.com/repos/thschroeter/cockroach/statuses/{sha}","languages_url":"https://api.github.com/repos/thschroeter/cockroach/languages","stargazers_url":"https://api.github.com/repos/thschroeter/cockroach/stargazers","contributors_url":"https://api.github.com/repos/thschroeter/cockroach/contributors","subscribers_url":"https://api.github.com/repos/thschroeter/cockroach/subscribers","subscription_url":"https://api.github.com/repos/thschroeter/cockroach/subscription","commits_url":"https://api.github.com/repos/thschroeter/cockroach/commits{/sha}","git_commits_url":"https://api.github.com/repos/thschroeter/cockroach/git/commits{/sha}","comments_url":"https://api.github.com/repos/thschroeter/cockroach/comments{/number}","issue_comment_url":"https://api.github.com/repos/thschroeter/cockroach/issues/comments{/number}","contents_url":"https://api.github.com/repos/thschroeter/cockroach/contents/{+path}","compare_url":"https://api.github.com/repos/thschroeter/cockroach/compare/{base}...{head}","merges_url":"https://api.github.com/repos/thschroeter/cockroach/merges","archive_url":"https://api.github.com/repos/thschroeter/cockroach/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/thschroeter/cockroach/downloads","issues_url":"https://api.github.com/repos/thschroeter/cockroach/issues{/number}","pulls_url":"https://api.github.com/repos/thschroeter/cockroach/pulls{/number}","milestones_url":"https://api.github.com/repos/thschroeter/cockroach/milestones{/number}","notifications_url":"https://api.github.com/repos/thschroeter/cockroach/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/thschroeter/cockroach/labels{/name}","releases_url":"https://api.github.com/repos/thschroeter/cockroach/releases{/id}","created_at":"2015-01-21T21:38:27Z","updated_at":"2015-01-21T21:38:29Z","pushed_at":"2015-09-15T18:07:10Z","git_url":"git://github.com/thschroeter/cockroach.git","ssh_url":"git@github.com:thschroeter/cockroach.git","clone_url":"https://github.com/thschroeter/cockroach.git","svn_url":"https://github.com/thschroeter/cockroach","homepage":null,"size":30989,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"cockroachdb:master","ref":"master","sha":"ce81bb6aeaf62988be641f91c327017c4342f6aa","user":{"login":"cockroachdb","id":6748139,"avatar_url":"https://avatars.githubusercontent.com/u/6748139?v=3","gravatar_id":"","url":"https://api.github.com/users/cockroachdb","html_url":"https://github.com/cockroachdb","followers_url":"https://api.github.com/users/cockroachdb/followers","following_url":"https://api.github.com/users/cockroachdb/following{/other_user}","gists_url":"https://api.github.com/users/cockroachdb/gists{/gist_id}","starred_url":"https://api.github.com/users/cockroachdb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cockroachdb/subscriptions","organizations_url":"https://api.github.com/users/cockroachdb/orgs","repos_url":"https://api.github.com/users/cockroachdb/repos","events_url":"https://api.github.com/users/cockroachdb/events{/privacy}","received_events_url":"https://api.github.com/users/cockroachdb/received_events","type":"Organization","site_admin":false},"repo":{"id":16563587,"name":"cockroach","full_name":"cockroachdb/cockroach","owner":{"login":"cockroachdb","id":6748139,"avatar_url":"https://avatars.githubusercontent.com/u/6748139?v=3","gravatar_id":"","url":"https://api.github.com/users/cockroachdb","html_url":"https://github.com/cockroachdb","followers_url":"https://api.github.com/users/cockroachdb/followers","following_url":"https://api.github.com/users/cockroachdb/following{/other_user}","gists_url":"https://api.github.com/users/cockroachdb/gists{/gist_id}","starred_url":"https://api.github.com/users/cockroachdb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cockroachdb/subscriptions","organizations_url":"https://api.github.com/users/cockroachdb/orgs","repos_url":"https://api.github.com/users/cockroachdb/repos","events_url":"https://api.github.com/users/cockroachdb/events{/privacy}","received_events_url":"https://api.github.com/users/cockroachdb/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cockroachdb/cockroach","description":"A Scalable, Geo-Replicated, Transactional Datastore","fork":false,"url":"https://api.github.com/repos/cockroachdb/cockroach","forks_url":"https://api.github.com/repos/cockroachdb/cockroach/forks","keys_url":"https://api.github.com/repos/cockroachdb/cockroach/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cockroachdb/cockroach/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cockroachdb/cockroach/teams","hooks_url":"https://api.github.com/repos/cockroachdb/cockroach/hooks","issue_events_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/events{/number}","events_url":"https://api.github.com/repos/cockroachdb/cockroach/events","assignees_url":"https://api.github.com/repos/cockroachdb/cockroach/assignees{/user}","branches_url":"https://api.github.com/repos/cockroachdb/cockroach/branches{/branch}","tags_url":"https://api.github.com/repos/cockroachdb/cockroach/tags","blobs_url":"https://api.github.com/repos/cockroachdb/cockroach/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cockroachdb/cockroach/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cockroachdb/cockroach/git/refs{/sha}","trees_url":"https://api.github.com/repos/cockroachdb/cockroach/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cockroachdb/cockroach/statuses/{sha}","languages_url":"https://api.github.com/repos/cockroachdb/cockroach/languages","stargazers_url":"https://api.github.com/repos/cockroachdb/cockroach/stargazers","contributors_url":"https://api.github.com/repos/cockroachdb/cockroach/contributors","subscribers_url":"https://api.github.com/repos/cockroachdb/cockroach/subscribers","subscription_url":"https://api.github.com/repos/cockroachdb/cockroach/subscription","commits_url":"https://api.github.com/repos/cockroachdb/cockroach/commits{/sha}","git_commits_url":"https://api.github.com/repos/cockroachdb/cockroach/git/commits{/sha}","comments_url":"https://api.github.com/repos/cockroachdb/cockroach/comments{/number}","issue_comment_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/comments{/number}","contents_url":"https://api.github.com/repos/cockroachdb/cockroach/contents/{+path}","compare_url":"https://api.github.com/repos/cockroachdb/cockroach/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cockroachdb/cockroach/merges","archive_url":"https://api.github.com/repos/cockroachdb/cockroach/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cockroachdb/cockroach/downloads","issues_url":"https://api.github.com/repos/cockroachdb/cockroach/issues{/number}","pulls_url":"https://api.github.com/repos/cockroachdb/cockroach/pulls{/number}","milestones_url":"https://api.github.com/repos/cockroachdb/cockroach/milestones{/number}","notifications_url":"https://api.github.com/repos/cockroachdb/cockroach/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cockroachdb/cockroach/labels{/name}","releases_url":"https://api.github.com/repos/cockroachdb/cockroach/releases{/id}","created_at":"2014-02-06T00:18:47Z","updated_at":"2015-09-15T08:47:56Z","pushed_at":"2015-09-15T18:18:49Z","git_url":"git://github.com/cockroachdb/cockroach.git","ssh_url":"git@github.com:cockroachdb/cockroach.git","clone_url":"https://github.com/cockroachdb/cockroach.git","svn_url":"https://github.com/cockroachdb/cockroach","homepage":null,"size":54319,"stargazers_count":5254,"watchers_count":5254,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":426,"mirror_url":null,"open_issues_count":183,"forks":426,"open_issues":183,"watchers":5254,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cockroachdb/cockroach/pulls/2512"},"html":{"href":"https://github.com/cockroachdb/cockroach/pull/2512"},"issue":{"href":"https://api.github.com/repos/cockroachdb/cockroach/issues/2512"},"comments":{"href":"https://api.github.com/repos/cockroachdb/cockroach/issues/2512/comments"},"review_comments":{"href":"https://api.github.com/repos/cockroachdb/cockroach/pulls/2512/comments"},"review_comment":{"href":"https://api.github.com/repos/cockroachdb/cockroach/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cockroachdb/cockroach/pulls/2512/commits"},"statuses":{"href":"https://api.github.com/repos/cockroachdb/cockroach/statuses/f5178034657d4dc91b5ea3864998b4370dc11444"}}}}