{"action":"opened","issue":{"url":"https://api.github.com/repos/skulpt/skulpt/issues/380","labels_url":"https://api.github.com/repos/skulpt/skulpt/issues/380/labels{/name}","comments_url":"https://api.github.com/repos/skulpt/skulpt/issues/380/comments","events_url":"https://api.github.com/repos/skulpt/skulpt/issues/380/events","html_url":"https://github.com/skulpt/skulpt/issues/380","id":69895499,"number":380,"title":"skulpt does not preserve negative zeros","user":{"login":"waywaaard","id":1634468,"avatar_url":"https://avatars.githubusercontent.com/u/1634468?v=3","gravatar_id":"","url":"https://api.github.com/users/waywaaard","html_url":"https://github.com/waywaaard","followers_url":"https://api.github.com/users/waywaaard/followers","following_url":"https://api.github.com/users/waywaaard/following{/other_user}","gists_url":"https://api.github.com/users/waywaaard/gists{/gist_id}","starred_url":"https://api.github.com/users/waywaaard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/waywaaard/subscriptions","organizations_url":"https://api.github.com/users/waywaaard/orgs","repos_url":"https://api.github.com/users/waywaaard/repos","events_url":"https://api.github.com/users/waywaaard/events{/privacy}","received_events_url":"https://api.github.com/users/waywaaard/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-04-21T16:42:39Z","updated_at":"2015-04-21T16:42:39Z","closed_at":null,"body":"Though javascript uses the IEEE747 number implementation with a positive and negative zero, skulpt does not preserve the sign of a zero. Therefore, a few unit tests are failing.\r\n\r\nThe main problem is not the ```Sk.builtin.nmber()``` constructor. Rather more it is located in ```compile.js``` while handling ```Num```. At this specific place the javascript code for creating a number is generated. The generator for numbers uses implicitly the ```toString()``` method of numbers which does not distinguish the signs. In order to fix this, we would need to use a custom toString method for the number values in order to preserve the signs.\r\n\r\nExample:\r\n```python\r\nf = -0.0\r\nprint(f)\r\n```"}}