You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@johnzon.apache.org by "Mark Struberg (JIRA)" <ji...@apache.org> on 2017/05/03 07:45:04 UTC

[jira] [Resolved] (JOHNZON-110) Support for large integrals

     [ https://issues.apache.org/jira/browse/JOHNZON-110?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mark Struberg resolved JOHNZON-110.
-----------------------------------
    Resolution: Fixed

> 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
>            Assignee: Romain Manni-Bucau
>             Fix For: 1.1.0
>
>
> 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)