{"action":"created","issue":{"url":"https://api.github.com/repos/golang/go/issues/12030","labels_url":"https://api.github.com/repos/golang/go/issues/12030/labels{/name}","comments_url":"https://api.github.com/repos/golang/go/issues/12030/comments","events_url":"https://api.github.com/repos/golang/go/issues/12030/events","html_url":"https://github.com/golang/go/issues/12030","id":99155262,"number":12030,"title":"cgo sprintf ","user":{"login":"xicheng","id":825689,"avatar_url":"https://avatars.githubusercontent.com/u/825689?v=3","gravatar_id":"","url":"https://api.github.com/users/xicheng","html_url":"https://github.com/xicheng","followers_url":"https://api.github.com/users/xicheng/followers","following_url":"https://api.github.com/users/xicheng/following{/other_user}","gists_url":"https://api.github.com/users/xicheng/gists{/gist_id}","starred_url":"https://api.github.com/users/xicheng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xicheng/subscriptions","organizations_url":"https://api.github.com/users/xicheng/orgs","repos_url":"https://api.github.com/users/xicheng/repos","events_url":"https://api.github.com/users/xicheng/events{/privacy}","received_events_url":"https://api.github.com/users/xicheng/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-05T08:52:03Z","updated_at":"2015-08-05T13:46:15Z","closed_at":null,"body":"print any number  aways get 'g'   when I use golua,\r\nI found it is caused by sprinf.\r\n\r\nin lua source code:\r\n#define LUA_NUMBER_SCAN\t\t\"%lf\"\r\n#define LUA_NUMBER_FMT\t\t\"%.14g\"\r\n#define lua_number2str(s,n)\tsprintf((s), LUA_NUMBER_FMT, (n))\r\n#define LUAI_MAXNUMBER2STR\t32 /* 16 digits, sign, point, and \\0 */\r\n\r\nso ,I wrote a  test code:\r\n/*\r\n#include <stdio.h>\r\n\r\nvoid my_print(float a)\r\n{\r\n\tchar buff[32];\r\n\tsprintf(buff,\"%.14g\",a);\r\n\tprintf(\"%s\\n\",buff);\r\n}\r\n*/\r\n\r\nC.my_print(20.5)\r\n\r\nit output  g\r\n\r\ni use go1.5 beta3  on win7 64"},"comment":{"url":"https://api.github.com/repos/golang/go/issues/comments/128001176","html_url":"https://github.com/golang/go/issues/12030#issuecomment-128001176","issue_url":"https://api.github.com/repos/golang/go/issues/12030","id":128001176,"user":{"login":"ianlancetaylor","id":3194333,"avatar_url":"https://avatars.githubusercontent.com/u/3194333?v=3","gravatar_id":"","url":"https://api.github.com/users/ianlancetaylor","html_url":"https://github.com/ianlancetaylor","followers_url":"https://api.github.com/users/ianlancetaylor/followers","following_url":"https://api.github.com/users/ianlancetaylor/following{/other_user}","gists_url":"https://api.github.com/users/ianlancetaylor/gists{/gist_id}","starred_url":"https://api.github.com/users/ianlancetaylor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ianlancetaylor/subscriptions","organizations_url":"https://api.github.com/users/ianlancetaylor/orgs","repos_url":"https://api.github.com/users/ianlancetaylor/repos","events_url":"https://api.github.com/users/ianlancetaylor/events{/privacy}","received_events_url":"https://api.github.com/users/ianlancetaylor/received_events","type":"User","site_admin":false},"created_at":"2015-08-05T13:46:15Z","updated_at":"2015-08-05T13:46:15Z","body":"Please show us a complete standalone Go example.  Thanks.\r\n\r\nI don't understand what Lua has to do with this."}}