scan dbl does not handle -inf, returns +inf instead

Issue #19 resolved
Former user created an issue

https://bitbucket.org/drjdpowell/jsontext/src/388ff02bbd9e30ebb0f8b4e83bc47da78df49b83/support/Get%20DBL.vi?at=default&fileviewer=file-view-default In the case "-Inf", returns Inf instead. Also it looks like the parser can't parse "Inf" or "-Inf" either, only the fully spelled out versions

Comments (6)

  1. D Smith

    To be clear, when it parses the string "-Infinity" it gets converted to the dbl value Inf. It does not appear to understand the string "Inf" or "-Inf". "Infinity" gets parsed correctly.

  2. James Powell repo owner

    Thanks. Fixed the -Infinity thing.

    But, should we support Inf and -Inf? They aren't proper JSON, and the LabVIEW extention is to use Infinity and -Infinity. Do other-language JSON libraries produce Inf/-Inf?

  3. D Smith

    I guess it didn't notify you? I made a pull request with both changes here and thought I assigned it to you: https://bitbucket.org/drjdpowell/jsontext/pull-requests/2/fix-issue-19/diff Well anyway, not exactly a complex issue :)

    I'm in favor of supporting both Inf and Infinity as Inf is what people see when they look at infinity on the diagram and its the most common abbreviation for infinity. Its also only a change on the parsing side -- the code still generates the more standard "Infinity" but accepts Inf as another representation.

  4. Log in to comment