johnzon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michele Vivoda (JIRA)" <j...@apache.org>
Subject [jira] [Created] (JOHNZON-110) Support for large integrals
Date Thu, 23 Mar 2017 21:24:41 GMT
Michele Vivoda created JOHNZON-110:
--------------------------------------

             Summary: Support for large integrals
                 Key: JOHNZON-110
                 URL: https://issues.apache.org/jira/browse/JOHNZON-110
             Project: Johnzon
          Issue Type: Improvement
    Affects Versions: 0.9.5
            Reporter: Michele Vivoda


While testing javax.json implementations I discovered Johnzon does not support very big integral
numbers , they loose the value when converted to Long and might also become negative. Big
decimals works fine.

Other implementations tested, the glassfish one and cookjson both support big integrals as
java.math.BigInteger

I would suggest to test the length of  an integral lexical without sign (being an integral
has no decimals, no exponential part) , if is more than 18 digits, use java.math.BigInteger

See also the implementation of Glassfish

https://java.net/projects/jsonp/sources/git/content/impl/src/main/java/org/glassfish/json/JsonNumberImpl.java?rev=de226229bd4bfab4aa87c11cab2f54efc50dffcb

JsonTokenizer.isDefinitelyLong at https://java.net/projects/jsonp/sources/git/content/impl/src/main/java/org/glassfish/json/JsonTokenizer.java?rev=de226229bd4bfab4aa87c11cab2f54efc50dffcb

Regards,
Michele Vivoda



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message