Skip to main content

[json-processing-spec issues] [JIRA] Issue Comment Edited: (JSON_PROCESSING_SPEC-41) Remove NumberType.LONG and rename NumberType.BigDecimal

  • From: "keilw (JIRA)" < >
  • To:
  • Subject: [json-processing-spec issues] [JIRA] Issue Comment Edited: (JSON_PROCESSING_SPEC-41) Remove NumberType.LONG and rename NumberType.BigDecimal
  • Date: Wed, 12 Dec 2012 14:19:02 +0000 (GMT+00:00)
  • Auto-submitted: auto-generated


    [ 
http://java.net/jira/browse/JSON_PROCESSING_SPEC-41?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=351778#action_351778
 ] 

keilw edited comment on JSON_PROCESSING_SPEC-41 at 12/12/12 2:18 PM:
---------------------------------------------------------------------

>The algorithm for distinguishing these two types should be based on whether 
>>BigDecimal#scale() is 0.

What would it be on ME, as BigDecimal and BigInteger would not be there?

Aside from that, I fully agree with renaming BIG_DECIMAL to something like 
DECIMAL, REAL or FLOATING, which covers all numbers with decimal value.

And keep INTEGER or rename INT, ideally dropping the LONG.

An alternative could again be the JSON spec which knows
int
   - digit
   - digit1-9 digits 
   -- digit
   -- digit1-9 digits

frac
    - . digits

exp
   - e digits

see http://json.org/

If there are sufficient algorithms to tell FRAC (which is quite similar to 
FLOATING or DECIMAL) from EXP, this may be closest to JSON design.

Werner

      was (Author: keilw):
    >The algorithm for distinguishing these two types should be based on 
whether >BigDecimal#scale() is 0.

What would it be on ME, as BigDecimal and BigInteger would not be there?

Aside from that, I fully agree with renaming BIG_DECIMAL to something like 
DECIMAL, REAL or FLOATING, which covers all numbers with decimal value.

And keep INTEGER or rename INT, ideally dropping the LONG.

An alternative could again be the JSON spec which knows
int
   digit
   digit1-9 digits 
   - digit
   - digit1-9 digits

frac
   . digits

exp
   e digits

see http://json.org/

If there are sufficient algorithms to tell FRAC (which is quite similar to 
FLOATING or DECIMAL) from EXP, this may be closest to JSON design.

Werner
  
> Remove NumberType.LONG and rename NumberType.BigDecimal
> -------------------------------------------------------
>
>                 Key: JSON_PROCESSING_SPEC-41
>                 URL: http://java.net/jira/browse/JSON_PROCESSING_SPEC-41
>             Project: json-processing-spec
>          Issue Type: Improvement
>    Affects Versions: 1.0-pr
>            Reporter: jhorstmann
>            Assignee: jitu
>             Fix For: 1.0-pr
>
>
> NumberType would be less confusing if it just stated the distinction 
> whether a number has a fractional part.
> A NumberType of INTEGER would guarantee that calling getBigIntegerValue 
> does not throw an ArithmeticException. The NumberType would be independent 
> of the actual magnitude of the number, thus calling getIntValueExact might 
> still throw an Exception if the number is smaller than Integer.MIN_VALUE of 
> larger than Integer.MAX_VALUE.
> The current NumberType BIG_DECIMAL should be renamed to just DECIMAL or 
> REAL (see http://en.wikipedia.org/wiki/Real_number) and would indicate that 
> the number has a fractional part and calling 
> get(Int|Long|BigInteger)ValueExact might throw an ArithmeticException.
> The algorithm for distinguishing these two types should be based on whether 
> BigDecimal#scale() is 0.  
> Discussion at 
> http://java.net/projects/json-processing-spec/lists/users/archive/2012-12/message/43

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://java.net/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


[json-processing-spec issues] [JIRA] Created: (JSON_PROCESSING_SPEC-41) Remove NumberType.LONG and rename NumberType.BigDecimal

jhorstmann (JIRA) 12/11/2012

[json-processing-spec issues] [JIRA] Commented: (JSON_PROCESSING_SPEC-41) Remove NumberType.LONG and rename NumberType.BigDecimal

jhorstmann (JIRA) 12/11/2012

[json-processing-spec issues] [JIRA] Updated: (JSON_PROCESSING_SPEC-41) Remove NumberType.LONG and rename NumberType.BigDecimal

jitu (JIRA) 12/11/2012

[json-processing-spec issues] [JIRA] Updated: (JSON_PROCESSING_SPEC-41) Remove NumberType.LONG and rename NumberType.BigDecimal

jitu (JIRA) 12/11/2012

[json-processing-spec issues] [JIRA] Issue Comment Edited: (JSON_PROCESSING_SPEC-41) Remove NumberType.LONG and rename NumberType.BigDecimal

jitu (JIRA) 12/12/2012

[json-processing-spec issues] [JIRA] Commented: (JSON_PROCESSING_SPEC-41) Remove NumberType.LONG and rename NumberType.BigDecimal

keilw (JIRA) 12/12/2012

[json-processing-spec issues] [JIRA] Issue Comment Edited: (JSON_PROCESSING_SPEC-41) Remove NumberType.LONG and rename NumberType.BigDecimal

keilw (JIRA) 12/12/2012

[json-processing-spec issues] [JIRA] Issue Comment Edited: (JSON_PROCESSING_SPEC-41) Remove NumberType.LONG and rename NumberType.BigDecimal

keilw (JIRA) 12/12/2012

[json-processing-spec issues] [JIRA] Issue Comment Edited: (JSON_PROCESSING_SPEC-41) Remove NumberType.LONG and rename NumberType.BigDecimal

keilw (JIRA) 12/12/2012

[json-processing-spec issues] [JIRA] Issue Comment Edited: (JSON_PROCESSING_SPEC-41) Remove NumberType.LONG and rename NumberType.BigDecimal

keilw (JIRA) 12/12/2012

[json-processing-spec issues] [JIRA] Updated: (JSON_PROCESSING_SPEC-41) Remove NumberType.LONG and rename NumberType.BigDecimal

jitu (JIRA) 12/13/2012

[json-processing-spec issues] [JIRA] Commented: (JSON_PROCESSING_SPEC-41) Remove NumberType.LONG and rename NumberType.BigDecimal

jhorstmann (JIRA) 12/13/2012

[json-processing-spec issues] [JIRA] Updated: (JSON_PROCESSING_SPEC-41) Remove NumberType.LONG and rename NumberType.BigDecimal

jitu (JIRA) 12/13/2012

[json-processing-spec issues] [JIRA] Resolved: (JSON_PROCESSING_SPEC-41) Remove NumberType.LONG and rename NumberType.BigDecimal

jitu (JIRA) 12/14/2012
 
 
Close
loading
Please Confirm
Close