{"action":"created","issue":{"url":"https://api.github.com/repos/sturlamolden/scipy/issues/1","labels_url":"https://api.github.com/repos/sturlamolden/scipy/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/sturlamolden/scipy/issues/1/comments","events_url":"https://api.github.com/repos/sturlamolden/scipy/issues/1/events","html_url":"https://github.com/sturlamolden/scipy/pull/1","id":97830098,"number":1,"title":"Rebase 4890","user":{"login":"rainwoodman","id":138060,"avatar_url":"https://avatars.githubusercontent.com/u/138060?v=3","gravatar_id":"","url":"https://api.github.com/users/rainwoodman","html_url":"https://github.com/rainwoodman","followers_url":"https://api.github.com/users/rainwoodman/followers","following_url":"https://api.github.com/users/rainwoodman/following{/other_user}","gists_url":"https://api.github.com/users/rainwoodman/gists{/gist_id}","starred_url":"https://api.github.com/users/rainwoodman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rainwoodman/subscriptions","organizations_url":"https://api.github.com/users/rainwoodman/orgs","repos_url":"https://api.github.com/users/rainwoodman/repos","events_url":"https://api.github.com/users/rainwoodman/events{/privacy}","received_events_url":"https://api.github.com/users/rainwoodman/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":33,"created_at":"2015-07-29T00:34:56Z","updated_at":"2015-08-02T11:45:54Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/sturlamolden/scipy/pulls/1","html_url":"https://github.com/sturlamolden/scipy/pull/1","diff_url":"https://github.com/sturlamolden/scipy/pull/1.diff","patch_url":"https://github.com/sturlamolden/scipy/pull/1.patch"},"body":"Rebase #5091 to this. Still needs some clean up."},"comment":{"url":"https://api.github.com/repos/sturlamolden/scipy/issues/comments/127019535","html_url":"https://github.com/sturlamolden/scipy/pull/1#issuecomment-127019535","issue_url":"https://api.github.com/repos/sturlamolden/scipy/issues/1","id":127019535,"user":{"login":"sturlamolden","id":1970862,"avatar_url":"https://avatars.githubusercontent.com/u/1970862?v=3","gravatar_id":"","url":"https://api.github.com/users/sturlamolden","html_url":"https://github.com/sturlamolden","followers_url":"https://api.github.com/users/sturlamolden/followers","following_url":"https://api.github.com/users/sturlamolden/following{/other_user}","gists_url":"https://api.github.com/users/sturlamolden/gists{/gist_id}","starred_url":"https://api.github.com/users/sturlamolden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sturlamolden/subscriptions","organizations_url":"https://api.github.com/users/sturlamolden/orgs","repos_url":"https://api.github.com/users/sturlamolden/repos","events_url":"https://api.github.com/users/sturlamolden/events{/privacy}","received_events_url":"https://api.github.com/users/sturlamolden/received_events","type":"User","site_admin":false},"created_at":"2015-08-02T11:45:54Z","updated_at":"2015-08-02T11:45:54Z","body":"```\r\n#include <math.h>\r\n#include <stdio.h>\r\nint main(int argc, char *argv[])\r\n{\r\n    printf(\"%f\\n\", fmod(4.5,2));\r\n    printf(\"%f\\n\", fmod(-4.5,2));\r\n    return 0;\r\n}\r\n```\r\n\r\nGives\r\n```\r\n$ ./test\r\n0.500000\r\n-0.500000\r\n```\r\n\r\nBugger, it rounds towards zero. Ok, then we do this:\r\n\r\n```C++\r\nfor (j=0; j<m; ++j) {\r\n    const npy_float64 box->fbox[j];\r\n    scratch[j] = std::fmod(xx_row[j], tmp);\r\n    if (scratch[j] < 0) scratch[j] += tmp;\r\n}\r\n```\r\n\r\n"}}