{"action":"created","issue":{"url":"https://api.github.com/repos/processing/processing/issues/4391","repository_url":"https://api.github.com/repos/processing/processing","labels_url":"https://api.github.com/repos/processing/processing/issues/4391/labels{/name}","comments_url":"https://api.github.com/repos/processing/processing/issues/4391/comments","events_url":"https://api.github.com/repos/processing/processing/issues/4391/events","html_url":"https://github.com/processing/processing/issues/4391","id":145808219,"number":4391,"title":"cast long to int failing for big numbers","user":{"login":"MNAF","id":18272087,"avatar_url":"https://avatars.githubusercontent.com/u/18272087?v=3","gravatar_id":"","url":"https://api.github.com/users/MNAF","html_url":"https://github.com/MNAF","followers_url":"https://api.github.com/users/MNAF/followers","following_url":"https://api.github.com/users/MNAF/following{/other_user}","gists_url":"https://api.github.com/users/MNAF/gists{/gist_id}","starred_url":"https://api.github.com/users/MNAF/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MNAF/subscriptions","organizations_url":"https://api.github.com/users/MNAF/orgs","repos_url":"https://api.github.com/users/MNAF/repos","events_url":"https://api.github.com/users/MNAF/events{/privacy}","received_events_url":"https://api.github.com/users/MNAF/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-04-04T21:20:42Z","updated_at":"2016-04-05T23:26:59Z","closed_at":null,"body":"`  long a = 1662664642;\r\n  int processingInt = int(a);\r\n  int javaInt = new Long(a).intValue();\r\n  println(a,processingInt, javaInt);`\r\n\r\ngives this result:\r\n\r\n`1662664642 1662664704 1662664642`\r\n\r\nin Processing 3.0.2.\r\n\r\nIt seems there is a long to float to int conversion somewhere, this code produces similar results:\r\n\r\n`int javaIntFromFloat = new Float(new Long(a).floatValue()).intValue();\r\nprintln(a, javaIntFromFloat);`\r\n\r\n`1662664642 1662664704\r\n`"},"comment":{"url":"https://api.github.com/repos/processing/processing/issues/comments/206032238","html_url":"https://github.com/processing/processing/issues/4391#issuecomment-206032238","issue_url":"https://api.github.com/repos/processing/processing/issues/4391","id":206032238,"user":{"login":"JakubValtar","id":3177098,"avatar_url":"https://avatars.githubusercontent.com/u/3177098?v=3","gravatar_id":"","url":"https://api.github.com/users/JakubValtar","html_url":"https://github.com/JakubValtar","followers_url":"https://api.github.com/users/JakubValtar/followers","following_url":"https://api.github.com/users/JakubValtar/following{/other_user}","gists_url":"https://api.github.com/users/JakubValtar/gists{/gist_id}","starred_url":"https://api.github.com/users/JakubValtar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JakubValtar/subscriptions","organizations_url":"https://api.github.com/users/JakubValtar/orgs","repos_url":"https://api.github.com/users/JakubValtar/repos","events_url":"https://api.github.com/users/JakubValtar/events{/privacy}","received_events_url":"https://api.github.com/users/JakubValtar/received_events","type":"User","site_admin":false},"created_at":"2016-04-05T23:26:58Z","updated_at":"2016-04-05T23:26:58Z","body":"This is a bug, we are missing parsing functions which accept longs, so it gets converted to float and then parsed to int. Either we should remove the claim that we accept longs from [the reference](https://processing.org/reference/intconvert_.html), or implement long versions for all parseXXX functions.\r\n\r\n@REAS @benfry?"}}