zephyr/lib
Christoph Winklhofer fc37c02eb1 json: improve parsing and serializing of 'float' and 'double'
Up to now, the handling of type float was offloaded to the users of the
JSON utility, with the token JSON_TOK_FLOAT.

Improve handling of floating point types and support the types 'float'
and 'double' in a built-in way so that they can be directly parsed to
and serialized from variables (of type float or double).

The types are serialized in the shortest representation, either as a
decimal number or in scientific notation:
  * float (with JSON_TOK_FLOAT_FP): encoded with maximal 9 digits
  * double (with JSON_TOK_DOUBLE_FP): encoded with maximal 16 digits
  * NaN, Infinity, -Infinity: encoded and decoded as:
    {"nan_val":NaN,"inf_pos":Infinity,"inf_neg":-Infinity}

Enable the floating point functionality with the Kconfig option:
  JSON_LIBRARY_FP_SUPPORT=y

It requires a libc implementation with support for floating point
functions: strtof(), strtod(), isnan() and isinf().

Fixes: #59412
Signed-off-by: Christoph Winklhofer <cj.winklhofer@gmail.com>
2025-04-09 22:05:14 +02:00
..
acpi lib: fix typo in multiple directories 2025-01-28 00:06:18 +01:00
cpp cpp: Add c++ version number 2025-02-10 15:57:26 +00:00
crc
hash
heap kernel: sys_heap: decouple realloc from aligned_realloc 2025-04-01 22:13:04 +02:00
libc libc: add comment to empty sys/cdefs.h file 2025-02-21 15:13:20 +00:00
mem_blocks
net_buf lib: net_buf: remove deprecated net_buf_put() and net_buf_get() functions 2025-03-12 19:04:19 +01:00
open-amp lib: open-amp: optional copy of rsc_table to memory region 2025-03-24 12:17:53 +01:00
os lib/os/fdtable: Remove ifdef on NATIVE_POSIX 2025-03-12 02:27:36 +01:00
posix posix: remove deprecated kconfig options 2025-03-12 19:03:52 +01:00
runtime
smf lib: smf: Fix handled bug causing events to not propagate. 2025-01-23 19:24:08 +01:00
utils json: improve parsing and serializing of 'float' and 'double' 2025-04-09 22:05:14 +02:00
CMakeLists.txt
Kconfig