incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Anderson <>
Subject Re: Canonical JSON [Proposal for digital signatures of documents]
Date Mon, 09 Mar 2009 18:52:46 GMT
On Mon, Mar 9, 2009 at 11:45 AM, Damien Katz <> wrote:
> The problem is floating point/text is a really difficult problem. I've
> butchered FP text conversion in Lotus Notes myself, it's way more
> complicated and subtle then I ever though it could be. While there are
> standardized algorithms, the reality is they are so many languages and
> libraries that have slight variations it's really hard to know when you got
> it right. You may have written a ton of tests and everything passes, but did
> you try it with "0.13421143112e-12" Because the bias tables in algorithm X
> is slightly different from algorithm Y, and none of your tests detect it.
> Yada yada.

I guess I was trying to punt on a canonical format, because of things
like this. In my estimation, the format could be less-than-canonical
and still capable of being reliably signed, if the signature is
willing to put bounds on the precision needed to remain valid. There
will be edge cases, but maybe we can discourage them by disallowing E
notation, so that all numbers would have to be in plain old
int.something format and if the signature wants to treat
0.13421143112e-12 as "0.00" that's it's business. Not perfect, but
better than disallowing floats?


Chris Anderson

View raw message