I'm in favor of adding it to breaking changes and keeping the new behaviour. Both ejson and jiffy use %g to encode numbers. This favors a shorter encoding. On reflection, this is more desirable than pretending that json distinguishes between ints and floats.
Sent from my iPhone On 12 Feb 2012, at 16:49, Noah Slater <[email protected]> wrote: > I've been over this before: > > http://code.google.com/p/simplejson/issues/detail?id=34 > > > From Bob Ippolito: > > Try alert(2.2000000000000002 == 2.2) in ANY browser. It will say true. >> JavaScript uses IEEE double for Number, always has, always will. > > > The general consensus seems to be that if you don't want JSON messing > around with your numbers, then you encode them as strings. Otherwise, > unless you're using integers, expect weirdness. > > However, I'm not sure I understand our choices here. > > Could someone explain the choices we have, with a summary of what the net > result would be? > > On Sun, Feb 12, 2012 at 2:58 PM, Benoit Chesneau <[email protected]>wrote: > >> On Sun, Feb 12, 2012 at 3:03 PM, Jason Smith <[email protected]> wrote: >>> tl;dr = Minor disagreement with Benoit but happy to go with his decision. >>> >>> On Sun, Feb 12, 2012 at 1:10 PM, Benoit Chesneau <[email protected]> >> wrote: >>>> On Sun, Feb 12, 2012 at 12:03 PM, Jason Smith <[email protected]> >> wrote: >>>>> On Sun, Feb 12, 2012 at 10:15 AM, Benoit Chesneau <[email protected]> >> wrote: >>>>>> well as a database, CouchDB shouldn't change the way data are saved >>>>>> in. I expect that the number I saved under the json type Number [1] >>>>>> defined by the spec [2] is correctly saved and returned as is. No >>>>>> roundtrip or precision lost should happen. >>>>> >>>>> Okay. "JSON type Number" is incoherent. JSON has only numerals, no >>>>> numbers. JavaScript standards are as relevant as FORTRAN standards. >>>>> But may we continue that discussion in JIRA? >>>>> >>>> I don't follow. JSON describes a number type, and refers to another >>>> iso standard too. How it's incoherent. >>> >>> I could be wrong but I don't see a reference to an ISO or similar >>> standard. I am reading RFC 4627. >>> >> The spec let me think that number should follow the ECMA-754 [1] . But >> i will double check. >> >> Anyway for me a document is a data I post on the disc and it seems >> reasonable to get the same result when I want to get it back. >> >> If it's not a regression, it isn't really a blocker I think. But I >> think we should definitely fix it. >> >> - benoƮt >> >> [1] http://ieeexplore.ieee.org/xpl/freeabs_all.jsp?arnumber=4610935 >>
