{"action":"created","issue":{"url":"https://api.github.com/repos/scp-fs2open/fs2open.github.com/issues/181","labels_url":"https://api.github.com/repos/scp-fs2open/fs2open.github.com/issues/181/labels{/name}","comments_url":"https://api.github.com/repos/scp-fs2open/fs2open.github.com/issues/181/comments","events_url":"https://api.github.com/repos/scp-fs2open/fs2open.github.com/issues/181/events","html_url":"https://github.com/scp-fs2open/fs2open.github.com/pull/181","id":88114735,"number":181,"title":"Math cleanup","user":{"login":"PeterMitsis","id":12752536,"avatar_url":"https://avatars.githubusercontent.com/u/12752536?v=3","gravatar_id":"","url":"https://api.github.com/users/PeterMitsis","html_url":"https://github.com/PeterMitsis","followers_url":"https://api.github.com/users/PeterMitsis/followers","following_url":"https://api.github.com/users/PeterMitsis/following{/other_user}","gists_url":"https://api.github.com/users/PeterMitsis/gists{/gist_id}","starred_url":"https://api.github.com/users/PeterMitsis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PeterMitsis/subscriptions","organizations_url":"https://api.github.com/users/PeterMitsis/orgs","repos_url":"https://api.github.com/users/PeterMitsis/repos","events_url":"https://api.github.com/users/PeterMitsis/events{/privacy}","received_events_url":"https://api.github.com/users/PeterMitsis/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-06-14T03:58:18Z","updated_at":"2015-06-18T05:56:11Z","closed_at":"2015-06-14T09:40:31Z","pull_request":{"url":"https://api.github.com/repos/scp-fs2open/fs2open.github.com/pulls/181","html_url":"https://github.com/scp-fs2open/fs2open.github.com/pull/181","diff_url":"https://github.com/scp-fs2open/fs2open.github.com/pull/181.diff","patch_url":"https://github.com/scp-fs2open/fs2open.github.com/pull/181.patch"},"body":"Cleans up some of the math code.\r\n - Removes unnecessary checks\r\n - Applies const and static keywords to facilitate in understanding scope and use\r\n - Caches or pre-calculates various expressions to prevent unnecessary runtime calculations"},"comment":{"url":"https://api.github.com/repos/scp-fs2open/fs2open.github.com/issues/comments/113045550","html_url":"https://github.com/scp-fs2open/fs2open.github.com/pull/181#issuecomment-113045550","issue_url":"https://api.github.com/repos/scp-fs2open/fs2open.github.com/issues/181","id":113045550,"user":{"login":"PeterMitsis","id":12752536,"avatar_url":"https://avatars.githubusercontent.com/u/12752536?v=3","gravatar_id":"","url":"https://api.github.com/users/PeterMitsis","html_url":"https://github.com/PeterMitsis","followers_url":"https://api.github.com/users/PeterMitsis/followers","following_url":"https://api.github.com/users/PeterMitsis/following{/other_user}","gists_url":"https://api.github.com/users/PeterMitsis/gists{/gist_id}","starred_url":"https://api.github.com/users/PeterMitsis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PeterMitsis/subscriptions","organizations_url":"https://api.github.com/users/PeterMitsis/orgs","repos_url":"https://api.github.com/users/PeterMitsis/repos","events_url":"https://api.github.com/users/PeterMitsis/events{/privacy}","received_events_url":"https://api.github.com/users/PeterMitsis/received_events","type":"User","site_admin":false},"created_at":"2015-06-18T05:56:11Z","updated_at":"2015-06-18T05:56:11Z","body":"Thanks for your feedback and review.  I agree with your decision about the necessity of reverting the patch set.\r\n\r\nI think that there is some value in the proposed changes (but certainly not all).  I would certainly like to try to fix things up so that I can make a contribution to this project.\r\n\r\nI certainly understand your concern about taking the square root of a negative number and propagating NaN's.  However, I fail to see how a negative magnitude can be achieved due to rounding errors.  This is not to say that I do not understand the concept of rounding errors, but rather how that even applies to this particular case.  In order to get a negative value when calculating a vector magnitude, a sign flip would be required which would really be more indicative of a hardware failure.  Perhaps this is due to ignorance on my part, but I have never seen the following documented anywhere with respect to floating point calculations:\r\n    1. multiplication of a number with itself resulting in a negative number\r\n    2. sum of a series of positive numbers resulting in a negative number\r\n    3. a sqrt() that results in a negative number (unless the number is -0.0f)\r\n\r\nIf this patch set were to broken up into multiple sets, how would you like to see it done?  I ask because I would like to learn how to be a better part-time contributor to this project.\r\n\r\nAside.\r\nIt wasn't until after I submitted this patch set that I discovered the computational efficiency of using <, <=, >, and >= over == and != when it comes to floating point.  I admit that I regrettably failed to perform disassembly to compare the generated code before and after when I messed with the comparator operators.  It shant recur."}}