[jira] [Commented] (COUCHDB-1410) Formally define number support

2013-07-01 Thread Alexander Shorin (JIRA)

[ 
https://issues.apache.org/jira/browse/COUCHDB-1410?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13697353#comment-13697353
 ] 

Alexander Shorin commented on COUCHDB-1410:
---

Back reference from docs: 
http://docs.couchdb.org/en/latest/json-structure.html#number-handling

> Formally define number support
> --
>
> Key: COUCHDB-1410
> URL: https://issues.apache.org/jira/browse/COUCHDB-1410
> Project: CouchDB
>  Issue Type: Improvement
>Affects Versions: 1.2
>Reporter: Robert Newson
>
> The JSON spec has a very loose definition of Number. CouchDB, as a database, 
> should have well-defined and first class support for numbers (both integral 
> and decimal). The precision of number support should be formally specified as 
> should the algorithm used to represent floating-point values, especially 
> where an approximation must be made in the conversion.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (COUCHDB-1410) Formally define number support

2012-02-21 Thread Jason Smith (Commented) (JIRA)

[ 
https://issues.apache.org/jira/browse/COUCHDB-1410?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13213201#comment-13213201
 ] 

Jason Smith commented on COUCHDB-1410:
--

Can this issue be merged with either of these two:

Big numbers changed to decimals: 
https://issues.apache.org/jira/browse/COUCHDB-724
JSON encoding of number changes: 
https://issues.apache.org/jira/browse/COUCHDB-1407

> Formally define number support
> --
>
> Key: COUCHDB-1410
> URL: https://issues.apache.org/jira/browse/COUCHDB-1410
> Project: CouchDB
>  Issue Type: Improvement
>Affects Versions: 1.2
>Reporter: Robert Newson
>Priority: Blocker
> Fix For: 1.3
>
>
> The JSON spec has a very loose definition of Number. CouchDB, as a database, 
> should have well-defined and first class support for numbers (both integral 
> and decimal). The precision of number support should be formally specified as 
> should the algorithm used to represent floating-point values, especially 
> where an approximation must be made in the conversion.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] [Commented] (COUCHDB-1410) Formally define number support

2012-02-15 Thread Jason Smith (Commented) (JIRA)

[ 
https://issues.apache.org/jira/browse/COUCHDB-1410?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13208491#comment-13208491
 ] 

Jason Smith commented on COUCHDB-1410:
--

Is Javascript relevant? The storage layer reads and writes documents. 
Everything arrives or departs (whether to HTTP layer or to a view server) as 
JSON. What couchjs does with that JSON seems a different issue. What my browser 
does with the JSON is a different issue.

I like Paul's point to simply document how it works and leave it at that. It's 
basically how most databases work. Maybe Couch 3000 would improve on that, but 
for today...

> Formally define number support
> --
>
> Key: COUCHDB-1410
> URL: https://issues.apache.org/jira/browse/COUCHDB-1410
> Project: CouchDB
>  Issue Type: Improvement
>Affects Versions: 1.2
>Reporter: Robert Newson
>Priority: Blocker
> Fix For: 1.3
>
>
> The JSON spec has a very loose definition of Number. CouchDB, as a database, 
> should have well-defined and first class support for numbers (both integral 
> and decimal). The precision of number support should be formally specified as 
> should the algorithm used to represent floating-point values, especially 
> where an approximation must be made in the conversion.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] [Commented] (COUCHDB-1410) Formally define number support

2012-02-15 Thread Robert Newson (Commented) (JIRA)

[ 
https://issues.apache.org/jira/browse/COUCHDB-1410?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13208478#comment-13208478
 ] 

Robert Newson commented on COUCHDB-1410:


I appreciate that the format is fully defined. Perhaps what I mean, instead, is 
the precision with which those numbers can be manipulated in view servers? I've 
certainly been stung by some crazy number rounding issues in the past, I don't 
think it's reasonable behavior for a database.

It sounds like this ticket is really two issues, 1) numbers can roundtrip 
safely to and from JSON, 2) numbers can be computed with within known (and 
consistent) bounds.

Issue 1 is something we need to resolve in ejson for the 1.2.0 release but 
sounds simple. To fulfill this ticket, we have to commit to not breaking 
roundtrip safety in future versions.

Issue 2, I suspect, is contentious. Or, at least, I suspect I desire stronger 
numeric handling than javascript typically delivers. I'll be happy here if we 
document, and preserve, some minimal standard.

/ramble


> Formally define number support
> --
>
> Key: COUCHDB-1410
> URL: https://issues.apache.org/jira/browse/COUCHDB-1410
> Project: CouchDB
>  Issue Type: Improvement
>Affects Versions: 1.2
>Reporter: Robert Newson
>Priority: Blocker
> Fix For: 1.3
>
>
> The JSON spec has a very loose definition of Number. CouchDB, as a database, 
> should have well-defined and first class support for numbers (both integral 
> and decimal). The precision of number support should be formally specified as 
> should the algorithm used to represent floating-point values, especially 
> where an approximation must be made in the conversion.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] [Commented] (COUCHDB-1410) Formally define number support

2012-02-14 Thread Jason Smith (Commented) (JIRA)

[ 
https://issues.apache.org/jira/browse/COUCHDB-1410?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13208167#comment-13208167
 ] 

Jason Smith commented on COUCHDB-1410:
--

Bob, the JSON definition of number is not loose. You have numerals, a dot, 
numerals, an "E", and numerals. That pretty much describes arbitrary precision 
decimals. Everybody keeps talking about JSON but the crucial matter is, what 
does Couch do with *numbers*; or put another way, how can we expect the JSON to 
*change* from a PUT to a GET.

Couch is used with instrumentation and scientific applications. Significant 
figures matter. It would be nice Couch maintained them. But there are 
workarounds, so that is merely a nice-to-have.

Simply identifying Couch's treatment of numbers is IMHO quite fine.

> Formally define number support
> --
>
> Key: COUCHDB-1410
> URL: https://issues.apache.org/jira/browse/COUCHDB-1410
> Project: CouchDB
>  Issue Type: Improvement
>Affects Versions: 1.2
>Reporter: Robert Newson
>Priority: Blocker
> Fix For: 1.3
>
>
> The JSON spec has a very loose definition of Number. CouchDB, as a database, 
> should have well-defined and first class support for numbers (both integral 
> and decimal). The precision of number support should be formally specified as 
> should the algorithm used to represent floating-point values, especially 
> where an approximation must be made in the conversion.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] [Commented] (COUCHDB-1410) Formally define number support

2012-02-14 Thread Robert Newson (Commented) (JIRA)

[ 
https://issues.apache.org/jira/browse/COUCHDB-1410?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13207806#comment-13207806
 ] 

Robert Newson commented on COUCHDB-1410:


If all that needs to happen to resolve this ticket is to include what you just 
said in the documentation (and maybe some tests that prove it is, and remains, 
true), I'll be quite happy.

> Formally define number support
> --
>
> Key: COUCHDB-1410
> URL: https://issues.apache.org/jira/browse/COUCHDB-1410
> Project: CouchDB
>  Issue Type: Improvement
>Affects Versions: 1.2
>Reporter: Robert Newson
>Priority: Blocker
> Fix For: 1.3
>
>
> The JSON spec has a very loose definition of Number. CouchDB, as a database, 
> should have well-defined and first class support for numbers (both integral 
> and decimal). The precision of number support should be formally specified as 
> should the algorithm used to represent floating-point values, especially 
> where an approximation must be made in the conversion.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] [Commented] (COUCHDB-1410) Formally define number support

2012-02-14 Thread Paul Joseph Davis (Commented) (JIRA)

[ 
https://issues.apache.org/jira/browse/COUCHDB-1410?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13207783#comment-13207783
 ] 

Paul Joseph Davis commented on COUCHDB-1410:


So this whole thing has really gotten blown out of proportion. While we have 
never formally documented what's going on internally, it can be described as 
such:

A number is parsed into one of two forms:

If the number contains a decimal point (".") or an exponent ("e" or "E") then 
the number is internally converted into an IEEE-754 floating point 
representation. This means that numbers containing either a decimal point or 
exponent are subject to the constraints of having a finite number of bits 
representing the number as is standard operating procedure.

If a number does not contain a decimal point or exponent then it is parsed as 
an integer with (theoretically) no loss of precision (I think precision is 
bound by the amount of RAM IIRC but I don't promise there aren't any bugs). 
(Side note for Jiffy, technically, if a number fits in a signed 64bit 
representation, that is used. If not then parsing is deferred back to Erlang 
which handles parsing as a bignum).

Literally, the only thing that's wrong in COUCHDB-1407 is that number 
formatting for doubles changed a wee bit and it has a simple fix and now people 
are getting all crazy about numbers and ignoring other places that JSON is 
munged. Blergh.

> Formally define number support
> --
>
> Key: COUCHDB-1410
> URL: https://issues.apache.org/jira/browse/COUCHDB-1410
> Project: CouchDB
>  Issue Type: Improvement
>Affects Versions: 1.2
>Reporter: Robert Newson
>Priority: Blocker
> Fix For: 1.3
>
>
> The JSON spec has a very loose definition of Number. CouchDB, as a database, 
> should have well-defined and first class support for numbers (both integral 
> and decimal). The precision of number support should be formally specified as 
> should the algorithm used to represent floating-point values, especially 
> where an approximation must be made in the conversion.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira