{"action":"created","issue":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/50571","repository_url":"https://api.github.com/repos/kubernetes/kubernetes","labels_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/50571/labels{/name}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/50571/comments","events_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/50571/events","html_url":"https://github.com/kubernetes/kubernetes/pull/50571","id":249862686,"number":50571,"title":"fix ScaledValue comment on scaling","user":{"login":"dixudx","id":5449021,"avatar_url":"https://avatars3.githubusercontent.com/u/5449021?v=4","gravatar_id":"","url":"https://api.github.com/users/dixudx","html_url":"https://github.com/dixudx","followers_url":"https://api.github.com/users/dixudx/followers","following_url":"https://api.github.com/users/dixudx/following{/other_user}","gists_url":"https://api.github.com/users/dixudx/gists{/gist_id}","starred_url":"https://api.github.com/users/dixudx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dixudx/subscriptions","organizations_url":"https://api.github.com/users/dixudx/orgs","repos_url":"https://api.github.com/users/dixudx/repos","events_url":"https://api.github.com/users/dixudx/events{/privacy}","received_events_url":"https://api.github.com/users/dixudx/received_events","type":"User","site_admin":false},"labels":[{"id":477397086,"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/cncf-cla:%20yes","name":"cncf-cla: yes","color":"bfe5bf","default":false},{"id":148225179,"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/lgtm","name":"lgtm","color":"15dd18","default":false},{"id":349530249,"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/release-note-none","name":"release-note-none","color":"c2e0c6","default":false},{"id":253450793,"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/size/XS","name":"size/XS","color":"009900","default":false}],"state":"closed","locked":false,"assignee":{"login":"MikeSpreitzer","id":14296719,"avatar_url":"https://avatars2.githubusercontent.com/u/14296719?v=4","gravatar_id":"","url":"https://api.github.com/users/MikeSpreitzer","html_url":"https://github.com/MikeSpreitzer","followers_url":"https://api.github.com/users/MikeSpreitzer/followers","following_url":"https://api.github.com/users/MikeSpreitzer/following{/other_user}","gists_url":"https://api.github.com/users/MikeSpreitzer/gists{/gist_id}","starred_url":"https://api.github.com/users/MikeSpreitzer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MikeSpreitzer/subscriptions","organizations_url":"https://api.github.com/users/MikeSpreitzer/orgs","repos_url":"https://api.github.com/users/MikeSpreitzer/repos","events_url":"https://api.github.com/users/MikeSpreitzer/events{/privacy}","received_events_url":"https://api.github.com/users/MikeSpreitzer/received_events","type":"User","site_admin":false},"assignees":[{"login":"xiang90","id":4479947,"avatar_url":"https://avatars0.githubusercontent.com/u/4479947?v=4","gravatar_id":"","url":"https://api.github.com/users/xiang90","html_url":"https://github.com/xiang90","followers_url":"https://api.github.com/users/xiang90/followers","following_url":"https://api.github.com/users/xiang90/following{/other_user}","gists_url":"https://api.github.com/users/xiang90/gists{/gist_id}","starred_url":"https://api.github.com/users/xiang90/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xiang90/subscriptions","organizations_url":"https://api.github.com/users/xiang90/orgs","repos_url":"https://api.github.com/users/xiang90/repos","events_url":"https://api.github.com/users/xiang90/events{/privacy}","received_events_url":"https://api.github.com/users/xiang90/received_events","type":"User","site_admin":false},{"login":"wojtek-t","id":10743879,"avatar_url":"https://avatars3.githubusercontent.com/u/10743879?v=4","gravatar_id":"","url":"https://api.github.com/users/wojtek-t","html_url":"https://github.com/wojtek-t","followers_url":"https://api.github.com/users/wojtek-t/followers","following_url":"https://api.github.com/users/wojtek-t/following{/other_user}","gists_url":"https://api.github.com/users/wojtek-t/gists{/gist_id}","starred_url":"https://api.github.com/users/wojtek-t/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wojtek-t/subscriptions","organizations_url":"https://api.github.com/users/wojtek-t/orgs","repos_url":"https://api.github.com/users/wojtek-t/repos","events_url":"https://api.github.com/users/wojtek-t/events{/privacy}","received_events_url":"https://api.github.com/users/wojtek-t/received_events","type":"User","site_admin":false},{"login":"MikeSpreitzer","id":14296719,"avatar_url":"https://avatars2.githubusercontent.com/u/14296719?v=4","gravatar_id":"","url":"https://api.github.com/users/MikeSpreitzer","html_url":"https://github.com/MikeSpreitzer","followers_url":"https://api.github.com/users/MikeSpreitzer/followers","following_url":"https://api.github.com/users/MikeSpreitzer/following{/other_user}","gists_url":"https://api.github.com/users/MikeSpreitzer/gists{/gist_id}","starred_url":"https://api.github.com/users/MikeSpreitzer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MikeSpreitzer/subscriptions","organizations_url":"https://api.github.com/users/MikeSpreitzer/orgs","repos_url":"https://api.github.com/users/MikeSpreitzer/repos","events_url":"https://api.github.com/users/MikeSpreitzer/events{/privacy}","received_events_url":"https://api.github.com/users/MikeSpreitzer/received_events","type":"User","site_admin":false}],"milestone":null,"comments":8,"created_at":"2017-08-13T09:24:07Z","updated_at":"2018-03-06T07:00:02Z","closed_at":"2017-08-17T18:37:47Z","author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/50571","html_url":"https://github.com/kubernetes/kubernetes/pull/50571","diff_url":"https://github.com/kubernetes/kubernetes/pull/50571.diff","patch_url":"https://github.com/kubernetes/kubernetes/pull/50571.patch"},"body":"<!--  Thanks for sending a pull request!  Here are some tips for you:\r\n1. If this is your first time, read our contributor guidelines https://git.k8s.io/community/contributors/devel/pull-requests.md#the-pr-submit-process and developer guide https://git.k8s.io/community/contributors/devel/development.md#development-guide\r\n2. If you want *faster* PR reviews, read how: https://git.k8s.io/community/contributors/devel/pull-requests.md#best-practices-for-faster-reviews\r\n3. Follow the instructions for writing a release note: https://git.k8s.io/community/contributors/devel/pull-requests.md#write-release-notes-if-needed\r\n-->\r\n\r\n**What this PR does / why we need it**:\r\n\r\n**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #50564\r\n\r\n**Special notes for your reviewer**:\r\n/assign @MikeSpreitzer @wojtek-t @xiang90\r\n\r\n**Release note**:\r\n<!--  Steps to write your release note:\r\n1. Use the release-note-* labels to set the release note state (if you have access)\r\n2. Enter your extended release note in the below block; leaving it blank means using the PR title as the release note. If no release note is required, just write `NONE`.\r\n-->\r\n```release-note\r\nNone\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/comments/370683436","html_url":"https://github.com/kubernetes/kubernetes/pull/50571#issuecomment-370683436","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/50571","id":370683436,"user":{"login":"MikeSpreitzer","id":14296719,"avatar_url":"https://avatars2.githubusercontent.com/u/14296719?v=4","gravatar_id":"","url":"https://api.github.com/users/MikeSpreitzer","html_url":"https://github.com/MikeSpreitzer","followers_url":"https://api.github.com/users/MikeSpreitzer/followers","following_url":"https://api.github.com/users/MikeSpreitzer/following{/other_user}","gists_url":"https://api.github.com/users/MikeSpreitzer/gists{/gist_id}","starred_url":"https://api.github.com/users/MikeSpreitzer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MikeSpreitzer/subscriptions","organizations_url":"https://api.github.com/users/MikeSpreitzer/orgs","repos_url":"https://api.github.com/users/MikeSpreitzer/repos","events_url":"https://api.github.com/users/MikeSpreitzer/events{/privacy}","received_events_url":"https://api.github.com/users/MikeSpreitzer/received_events","type":"User","site_admin":false},"created_at":"2018-03-06T07:00:02Z","updated_at":"2018-03-06T07:00:02Z","author_association":"COLLABORATOR","body":"I am sorry, but the comment is still wrong.  The comment still says \"ScaledValue returns the value of ceil(q * 10^scale)\".  Please look carefully at the code.  Following are some examples of evidence that the comment is wrong.\r\n\r\nIn the same file we see\r\n```\r\n// MilliValue returns the value of ceil(q * 1000); this could overflow an int64;\r\n// if that's a concern, call Value() first to verify the number is small enough.\r\nfunc (q *Quantity) MilliValue() int64 {\r\n\treturn q.ScaledValue(Milli)\r\n}\r\n```\r\nand in `amount.go` we see that `Milli Scale = -3`.  So `q.ScaledValue(-3)` returns the value of `ceil(q * 1000)` --- that is dividing by 10^-3, not multiplying.\r\n\r\nLooking into the implementation of `ScaledValue`, we see that in one case it devolves to `q.i.AsScaledInt64(scale)`.  Looking over in `amount.go` at the comment on `AsScaledInt64`, we see the remark that \"(1e20).AsScaledInt64(1) would result in overflow because 1e19 is not representable as an int64\".  Note that 1e19 is 1e20 divided by 10^1, not multiplied."}}
{"actor":{"display_login":"MikeSpreitzer"}}