{"action":"created","issue":{"url":"https://api.github.com/repos/softlab-ntua/pazcal/issues/3","labels_url":"https://api.github.com/repos/softlab-ntua/pazcal/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/softlab-ntua/pazcal/issues/3/comments","events_url":"https://api.github.com/repos/softlab-ntua/pazcal/issues/3/events","html_url":"https://github.com/softlab-ntua/pazcal/issues/3","id":112020836,"number":3,"title":"Default precision value in __pazcal_write","user":{"login":"skydraios","id":2033845,"avatar_url":"https://avatars.githubusercontent.com/u/2033845?v=3","gravatar_id":"","url":"https://api.github.com/users/skydraios","html_url":"https://github.com/skydraios","followers_url":"https://api.github.com/users/skydraios/followers","following_url":"https://api.github.com/users/skydraios/following{/other_user}","gists_url":"https://api.github.com/users/skydraios/gists{/gist_id}","starred_url":"https://api.github.com/users/skydraios/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/skydraios/subscriptions","organizations_url":"https://api.github.com/users/skydraios/orgs","repos_url":"https://api.github.com/users/skydraios/repos","events_url":"https://api.github.com/users/skydraios/events{/privacy}","received_events_url":"https://api.github.com/users/skydraios/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-10-18T13:36:58Z","updated_at":"2015-10-18T18:23:42Z","closed_at":"2015-10-18T18:23:42Z","body":"**In** `include/pazcal`:\r\n\r\n```c++\r\ninline void __pazcal_write_fmt (double a, int w, int p)\r\n{\r\n  printf(\"%*.*lf\", w, p, a);\r\n}\r\n...\r\ntemplate<typename T>\r\ninline void __pazcal_write (T const& a)\r\n{\r\n  __pazcal_write_fmt(a, 0, 0);\r\n}\r\n```\r\n\r\nThis sets the default precision of printf to zero.\r\nTherefore all floats and doubles (thus, REALs too) are printed as integers.\r\n\r\n**Minimal working example**:\r\n\r\n```\r\nPROGRAM test() {\r\n\tREAL a = 3.14;\r\n\tWRITELN(a);\r\n}\r\n```\r\n\r\n**Output**:\r\n```\r\n3\r\n```\r\n\r\n**Suggested fix**:\r\nChange passed arguments of __pazcal_write_fmt to `__pazcal_write_fmt(a, 0, 6);` wherever needed."},"comment":{"url":"https://api.github.com/repos/softlab-ntua/pazcal/issues/comments/149036666","html_url":"https://github.com/softlab-ntua/pazcal/issues/3#issuecomment-149036666","issue_url":"https://api.github.com/repos/softlab-ntua/pazcal/issues/3","id":149036666,"user":{"login":"nickie","id":1158347,"avatar_url":"https://avatars.githubusercontent.com/u/1158347?v=3","gravatar_id":"","url":"https://api.github.com/users/nickie","html_url":"https://github.com/nickie","followers_url":"https://api.github.com/users/nickie/followers","following_url":"https://api.github.com/users/nickie/following{/other_user}","gists_url":"https://api.github.com/users/nickie/gists{/gist_id}","starred_url":"https://api.github.com/users/nickie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nickie/subscriptions","organizations_url":"https://api.github.com/users/nickie/orgs","repos_url":"https://api.github.com/users/nickie/repos","events_url":"https://api.github.com/users/nickie/events{/privacy}","received_events_url":"https://api.github.com/users/nickie/received_events","type":"User","site_admin":false},"created_at":"2015-10-18T18:23:42Z","updated_at":"2015-10-18T18:23:42Z","body":"Κάνε όμως ένα merge request, να μπεις κι εσύ στο hall of fame, να γλυτώσω κι εγώ το ψάξιμο...  Thanks Θοδωρή... :-)"}}