{"action":"created","issue":{"url":"https://api.github.com/repos/WebAssembly/design/issues/292","labels_url":"https://api.github.com/repos/WebAssembly/design/issues/292/labels{/name}","comments_url":"https://api.github.com/repos/WebAssembly/design/issues/292/comments","events_url":"https://api.github.com/repos/WebAssembly/design/issues/292/events","html_url":"https://github.com/WebAssembly/design/issues/292","id":100153442,"number":292,"title":"Textual format: floating-point representation","user":{"login":"jfbastien","id":298127,"avatar_url":"https://avatars.githubusercontent.com/u/298127?v=3","gravatar_id":"","url":"https://api.github.com/users/jfbastien","html_url":"https://github.com/jfbastien","followers_url":"https://api.github.com/users/jfbastien/followers","following_url":"https://api.github.com/users/jfbastien/following{/other_user}","gists_url":"https://api.github.com/users/jfbastien/gists{/gist_id}","starred_url":"https://api.github.com/users/jfbastien/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jfbastien/subscriptions","organizations_url":"https://api.github.com/users/jfbastien/orgs","repos_url":"https://api.github.com/users/jfbastien/repos","events_url":"https://api.github.com/users/jfbastien/events{/privacy}","received_events_url":"https://api.github.com/users/jfbastien/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/WebAssembly/design/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-08-10T19:51:35Z","updated_at":"2015-08-10T20:44:15Z","closed_at":null,"body":"I'm opening up a can of bikeshed: how should the **textual** WebAssembly format represent floating-point numbers?\r\n\r\n**This has nothing to do with the binary format.**\r\n\r\nKeep in mind:\r\n* Currently we support `f32` and `f64`.\r\n* We'll eventually support vectors of these types.\r\n* Must support NaN properly.\r\n  - Do we support a leading sign?\r\n  - We don't differentiate between different NaN types at the moment. Do we allow *n-char-sequence* after NaN as `printf` does?\r\n  - How do we capitalize NaN (if we represent it as text at all)? `nan` `NaN` `NAN`.\r\n* Must support `±infinity`.\r\n  - How do we spell it (if we represent it as text at all)? `infinity` `INFINITY` `inf` `INF` `∞`.\r\n* Must support `±0`.\r\n* Must support denormals, but that's likely a non-issue.\r\n* Not all numbers are accurately representable as `f32` or `f64`: decimal (e.g. `3.141592`) and exponential (e.g.  `6.022140e23`) often have such non-representable numbers that need to be rounded somehow.\r\n* We can support multiple inputs for programmer's convenience, but then we're making the text format parser more complex (which doesn't really matter).\r\n\r\nA few ideas:\r\n* little-endian hexadecimal representation of the IEEE-754 number (e.g. `0x7FF8000000000000` is positive NaN with `0` bits). This is effectively a `reinterpret_cast` from integer to floating-point.\r\n* C99 hexadecimal floating-point (e.g. `0x1p1` is 2.0).\r\n* Precisely-representable decimal and exponential notations only.\r\n* Any decimal and exponential notation, with a spec-mandated rounding.\r\n\r\nOr a combination of the above."},"comment":{"url":"https://api.github.com/repos/WebAssembly/design/issues/comments/129601119","html_url":"https://github.com/WebAssembly/design/issues/292#issuecomment-129601119","issue_url":"https://api.github.com/repos/WebAssembly/design/issues/292","id":129601119,"user":{"login":"jfbastien","id":298127,"avatar_url":"https://avatars.githubusercontent.com/u/298127?v=3","gravatar_id":"","url":"https://api.github.com/users/jfbastien","html_url":"https://github.com/jfbastien","followers_url":"https://api.github.com/users/jfbastien/followers","following_url":"https://api.github.com/users/jfbastien/following{/other_user}","gists_url":"https://api.github.com/users/jfbastien/gists{/gist_id}","starred_url":"https://api.github.com/users/jfbastien/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jfbastien/subscriptions","organizations_url":"https://api.github.com/users/jfbastien/orgs","repos_url":"https://api.github.com/users/jfbastien/repos","events_url":"https://api.github.com/users/jfbastien/events{/privacy}","received_events_url":"https://api.github.com/users/jfbastien/received_events","type":"User","site_admin":false},"created_at":"2015-08-10T20:44:15Z","updated_at":"2015-08-10T20:44:15Z","body":"I should have put a [decent reference for hexadecimal floating-point](http://www.exploringbinary.com/hexadecimal-floating-point-constants/)."}}