{"action":"created","issue":{"url":"https://api.github.com/repos/pixie-lang/pixie/issues/362","labels_url":"https://api.github.com/repos/pixie-lang/pixie/issues/362/labels{/name}","comments_url":"https://api.github.com/repos/pixie-lang/pixie/issues/362/comments","events_url":"https://api.github.com/repos/pixie-lang/pixie/issues/362/events","html_url":"https://github.com/pixie-lang/pixie/issues/362","id":102269707,"number":362,"title":"floating point literals for +-Inf, NaN ?","user":{"login":"joshua-g","id":6463868,"avatar_url":"https://avatars.githubusercontent.com/u/6463868?v=3","gravatar_id":"","url":"https://api.github.com/users/joshua-g","html_url":"https://github.com/joshua-g","followers_url":"https://api.github.com/users/joshua-g/followers","following_url":"https://api.github.com/users/joshua-g/following{/other_user}","gists_url":"https://api.github.com/users/joshua-g/gists{/gist_id}","starred_url":"https://api.github.com/users/joshua-g/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joshua-g/subscriptions","organizations_url":"https://api.github.com/users/joshua-g/orgs","repos_url":"https://api.github.com/users/joshua-g/repos","events_url":"https://api.github.com/users/joshua-g/events{/privacy}","received_events_url":"https://api.github.com/users/joshua-g/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/pixie-lang/pixie/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-08-21T00:47:20Z","updated_at":"2015-12-09T12:57:09Z","closed_at":null,"body":"How do you (the language designers) feel about having a way to write literals for +- infinity and NaN? Currently you can generate these values via arithmetic. For instance, `(/ 1.0 0)` evaluates to positive infinity. Also, the literal `1e309` will evaluate to positive infinity. But `inf` doesn't have a canonical output representation in pixie. So if a program uses 1e400 and you try to compile it using pixie-vm -c, the compiled program will use the symbol `inf` instead of a float. That leads to a confusing error when you try to re-read the compiled file.\r\n\r\nI think 0.Inf, -0.Inf, and 0.NaN are good ideas. cf. https://github.com/edn-format/edn/issues/2#issuecomment-31765748\r\n\r\nHaving +- infinity available could also simplify implementing or extending some algorithms. For instance, as initial values when computing maxes or mins. Or, if a function is already written in terms of some finite upper bound, it can often be trivially extended to work with no bound just by replacing the upper bound with +inf. E.g. `(range 0.Inf)`"},"comment":{"url":"https://api.github.com/repos/pixie-lang/pixie/issues/comments/163221500","html_url":"https://github.com/pixie-lang/pixie/issues/362#issuecomment-163221500","issue_url":"https://api.github.com/repos/pixie-lang/pixie/issues/362","id":163221500,"user":{"login":"jmglov","id":224070,"avatar_url":"https://avatars.githubusercontent.com/u/224070?v=3","gravatar_id":"","url":"https://api.github.com/users/jmglov","html_url":"https://github.com/jmglov","followers_url":"https://api.github.com/users/jmglov/followers","following_url":"https://api.github.com/users/jmglov/following{/other_user}","gists_url":"https://api.github.com/users/jmglov/gists{/gist_id}","starred_url":"https://api.github.com/users/jmglov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmglov/subscriptions","organizations_url":"https://api.github.com/users/jmglov/orgs","repos_url":"https://api.github.com/users/jmglov/repos","events_url":"https://api.github.com/users/jmglov/events{/privacy}","received_events_url":"https://api.github.com/users/jmglov/received_events","type":"User","site_admin":false},"created_at":"2015-12-09T12:57:09Z","updated_at":"2015-12-09T12:57:09Z","body":"I'll take a swing at this one. Looks relatively straight-forward."}}