{"action":"created","issue":{"url":"https://api.github.com/repos/HaxeFlixel/flixel/issues/2126","repository_url":"https://api.github.com/repos/HaxeFlixel/flixel","labels_url":"https://api.github.com/repos/HaxeFlixel/flixel/issues/2126/labels{/name}","comments_url":"https://api.github.com/repos/HaxeFlixel/flixel/issues/2126/comments","events_url":"https://api.github.com/repos/HaxeFlixel/flixel/issues/2126/events","html_url":"https://github.com/HaxeFlixel/flixel/issues/2126","id":289632750,"node_id":"MDU6SXNzdWUyODk2MzI3NTA=","number":2126,"title":"FlxMath.roundDecimal gives negative result for large(ish) positive inputs","user":{"login":"ttencate","id":90930,"node_id":"MDQ6VXNlcjkwOTMw","avatar_url":"https://avatars0.githubusercontent.com/u/90930?v=4","gravatar_id":"","url":"https://api.github.com/users/ttencate","html_url":"https://github.com/ttencate","followers_url":"https://api.github.com/users/ttencate/followers","following_url":"https://api.github.com/users/ttencate/following{/other_user}","gists_url":"https://api.github.com/users/ttencate/gists{/gist_id}","starred_url":"https://api.github.com/users/ttencate/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ttencate/subscriptions","organizations_url":"https://api.github.com/users/ttencate/orgs","repos_url":"https://api.github.com/users/ttencate/repos","events_url":"https://api.github.com/users/ttencate/events{/privacy}","received_events_url":"https://api.github.com/users/ttencate/received_events","type":"User","site_admin":false},"labels":[{"id":46251470,"node_id":"MDU6TGFiZWw0NjI1MTQ3MA==","url":"https://api.github.com/repos/HaxeFlixel/flixel/labels/Bug","name":"Bug","color":"e11d21","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2018-01-18T13:42:52Z","updated_at":"2018-06-06T09:46:42Z","closed_at":"2018-03-22T14:54:19Z","author_association":"CONTRIBUTOR","body":"- **Haxe version:** 3.4.4\r\n- **Flixel version:** 4.1.0\r\n- **OpenFL version:** 3.6.1\r\n- **Lime version:** 2.9.1\r\n- **Affected targets:** neko, probably more\r\n\r\n________________________________\r\n\r\n**Code snippet reproducing the issue**:\r\n\r\n```haxe\r\npackage;\r\n\r\nimport flixel.FlxState;\r\nimport flixel.math.FlxMath;\r\n\r\nclass PlayState extends FlxState\r\n{\r\n\toverride public function create():Void\r\n\t{\r\n\t\ttrace(FlxMath.roundDecimal(Sys.time(), 3));\r\n\t}\r\n}\r\n```\r\n\r\n(I haven't actually run this exact code, but you get the idea.)\r\n\r\n________________________________\r\n\r\n**Observed behavior:** a negative value is printed, like `-2147483.648`.\r\n\r\n**Expected behavior:** the current Unix time rounded to three decimals, like `1516282651.202`.\r\n\r\nThis is most likely due to overflow, because the [`roundDecimal` implementation](https://github.com/HaxeFlixel/flixel/blob/e56837f31239649e278910f26b49c7be5232590a/flixel/math/FlxMath.hx#L58) multiplies its argument by 10 repeatedly."},"comment":{"url":"https://api.github.com/repos/HaxeFlixel/flixel/issues/comments/395011361","html_url":"https://github.com/HaxeFlixel/flixel/issues/2126#issuecomment-395011361","issue_url":"https://api.github.com/repos/HaxeFlixel/flixel/issues/2126","id":395011361,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NTAxMTM2MQ==","user":{"login":"Gama11","id":2620907,"node_id":"MDQ6VXNlcjI2MjA5MDc=","avatar_url":"https://avatars0.githubusercontent.com/u/2620907?v=4","gravatar_id":"","url":"https://api.github.com/users/Gama11","html_url":"https://github.com/Gama11","followers_url":"https://api.github.com/users/Gama11/followers","following_url":"https://api.github.com/users/Gama11/following{/other_user}","gists_url":"https://api.github.com/users/Gama11/gists{/gist_id}","starred_url":"https://api.github.com/users/Gama11/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gama11/subscriptions","organizations_url":"https://api.github.com/users/Gama11/orgs","repos_url":"https://api.github.com/users/Gama11/repos","events_url":"https://api.github.com/users/Gama11/events{/privacy}","received_events_url":"https://api.github.com/users/Gama11/received_events","type":"User","site_admin":false},"created_at":"2018-06-06T09:46:42Z","updated_at":"2018-06-06T09:46:42Z","author_association":"MEMBER","body":"Hm.. I'd love to know what exactly the issue was there, would be good if you could try again with latest flixel (4.4.1). Note that you can use that even with older OpenFL, so you don't have to risk upgrading that."}}
{"actor":{"display_login":"Gama11"}}