couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Newson <robert.new...@gmail.com>
Subject Re: [jira] Commented: (COUCHDB-796) Bignum support
Date Sat, 12 Jun 2010 19:11:45 GMT
Jan also mentioned your new library on IRC, so that was certainly one
of the candidates for that approach.

While it's true that the Javascript view server is where the 32-bit
limitation will be most noticeable, I think we want bignum support
everywhere that the limitation appears.

B.


On Sat, Jun 12, 2010 at 8:06 PM, Jason Smith <jhs@couch.io> wrote:
> On Sun, Jun 13, 2010 at 01:24, Robert Newson (JIRA) <jira@apache.org> wrote:
>
>>
>>    [
>> https://issues.apache.org/jira/browse/COUCHDB-796?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12878298#action_12878298]
>>
>> Robert Newson commented on COUCHDB-796:
>> ---------------------------------------
>>
>> Sorry, I pasted a terse summary from #couchdb and was then too busy to
>> flesh this out.
>>
>> I'm actually not sure I like the idea of tweaking mochijson2.erl, though it
>> was suggested (by you iirc ;). Also the notion that numbers magically become
>> strings at some point feels wrong, but so also does the notion that a sum()
>> overflows or goes wrong when you hit that limit too.
>>
>> Rather, I think a guarantee that some bignum.js library is always available
>> and some prominent docs about it. Ideally a BigDecimal and BigInteger class
>> like Java has (yes, kill me).
>>
>
> Weird, I just created that exact project the other day.
> http://github.com/jhs/bigdecimal.js
>
> It is indeed the Java class! It is the Apache Harmony BigDecimal/BigInteger
> implementation, compiled to Javascript thanks to GWT. This list isn't the
> place to debate whether that's wise but a the very least, CouchDB's default
> view server can support BigDecimal. I even put up a demo expression
> evaluator:
>
> http://jhs.couchone.com/bigdecimal/_design/bigdecimal_demo/_show/ui?e=5192834791234712811238476129384671293847611923192386479347.1234876123467129384761234%20*%205123412612351263.1123412365123541234
>
> What is my point? That CouchDB perhaps does not need bigdecimal support in
> mochijson2 because it is quite straightforward to get things working within
> the view server.
>
> --
> Jason Smith
> Couchio Hosting
>

Mime
View raw message