{"action":"closed","issue":{"url":"https://api.github.com/repos/dart-lang/sdk/issues/26053","repository_url":"https://api.github.com/repos/dart-lang/sdk","labels_url":"https://api.github.com/repos/dart-lang/sdk/issues/26053/labels{/name}","comments_url":"https://api.github.com/repos/dart-lang/sdk/issues/26053/comments","events_url":"https://api.github.com/repos/dart-lang/sdk/issues/26053/events","html_url":"https://github.com/dart-lang/sdk/issues/26053","id":142460147,"number":26053,"title":"An integer literal with exponent (e.g. 1e8) is a double","user":{"login":"filiph","id":919717,"avatar_url":"https://avatars.githubusercontent.com/u/919717?v=3","gravatar_id":"","url":"https://api.github.com/users/filiph","html_url":"https://github.com/filiph","followers_url":"https://api.github.com/users/filiph/followers","following_url":"https://api.github.com/users/filiph/following{/other_user}","gists_url":"https://api.github.com/users/filiph/gists{/gist_id}","starred_url":"https://api.github.com/users/filiph/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/filiph/subscriptions","organizations_url":"https://api.github.com/users/filiph/orgs","repos_url":"https://api.github.com/users/filiph/repos","events_url":"https://api.github.com/users/filiph/events{/privacy}","received_events_url":"https://api.github.com/users/filiph/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/dart-lang/sdk/labels/area-language","name":"area-language","color":"c7def8"},{"url":"https://api.github.com/repos/dart-lang/sdk/labels/docs-language-spec","name":"docs-language-spec","color":"d4c5f9"},{"url":"https://api.github.com/repos/dart-lang/sdk/labels/Type:%20bug","name":"Type: bug","color":"ededed"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-03-21T20:25:19Z","updated_at":"2016-09-28T08:29:22Z","closed_at":"2016-09-28T08:29:22Z","body":"Consider this code:\r\n\r\n```\r\nvoid main() {\r\n  var count = 1e8;\r\n  doSomething(count);\r\n}\r\n\r\nvoid doSomething(int count) {\r\n  print(count);\r\n}\r\n```\r\nhttps://dartpad.dartlang.org/59e0e9cd1828c2a2b167\r\n\r\nThis shows the following hint (and throws in checked mode):\r\n\r\n> The argument type 'double' cannot be assigned to the parameter type 'int'\r\n\r\nAccording to [specification](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-408.pdf) (at least how I read it), `count` should be an integer in this instance. Snip from page 53 (emphasis mine):\r\n\r\n> If a numeric literal begins with the prefix ‘0x’ or ‘0X’, it denotes the hexadecimal integer represented by the part of the literal following ‘0x’ (respectively ‘0X’). Otherwise, **if the numeric literal does not include a decimal point it denotes a decimal integer.** Otherwise, the numeric literal denotes a 64 bit double precision floating point number as specified by the IEEE 754 standard."}}
{"actor":{"display_login":"lrhn"}}