Back Midas Rome Roody Rootana
  Midas DAQ System  Not logged in ELOG logo
Entry  05 Apr 2013, Konstantin Olchanski, Info, ODB JSON support 
    Reply  10 May 2013, Konstantin Olchanski, Info, mhttpd JSON support 
       Reply  17 May 2013, Konstantin Olchanski, Info, mhttpd JSON-P support 
          Reply  31 May 2013, Konstantin Olchanski, Info, mhttpd JSON-P support 
    Reply  27 Sep 2013, Konstantin Olchanski, Info, ODB JSON support 
       Reply  09 Oct 2013, Konstantin Olchanski, Info, ODB JSON support 
          Reply  17 Mar 2014, Konstantin Olchanski, Info, ODB JSON support 
             Reply  12 Apr 2022, Konstantin Olchanski, Info, ODB JSON support 
                Reply  13 Apr 2022, Stefan Ritt, Info, ODB JSON support 
                   Reply  13 Apr 2022, Konstantin Olchanski, Info, ODB JSON support 
Message ID: 2384     Entry time: 13 Apr 2022     In reply to: 2383
Author: Konstantin Olchanski 
Topic: Info 
Subject: ODB JSON support 
> > Per xkcd, there is a new json standard "json5". In addition to other things, numeric
> > values NaN, +Infinity and -Infinity are encoded as literals NaN, Infinity and -Infinity (without quotes):
> > https://spec.json5.org/#numbers
> 
> Just for curiosity: Is this implemented by the midas json library now?

MIDAS encodes NaN, Infinity and -Infinity as javascript compatible "NaN", "Infinity" and "-Infinity",
this encoding is popular with other projects and allows correct transmission of these values
from ODB to javascript. The test code for this is on the MIDAS "Example" page, scroll down
to "Test nan and inf encoding".

I think this type of encoding, using strings to encode special values, is more in the spirit of json,
compared to other approaches such as adding special literals just for a few special cases
leaving other special cases in the cold (ieee-754 specifies several different types of NaN,
you can encode them into different nan-strings, but not into the one nan-literal (need more nan-literals,
requires change to the standard and change to every json parser).

As editorial comment, it boggles my mind, what university or kindergarden these people went to
who made the biggest number, the smallest number and the imaginary number (sqrt(-1))
all equal to zero (all encoded as literal null).

K.O.
ELOG V3.1.4-2e1708b5