octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #64960] jsonencode produces different results


From: anonymous
Subject: [Octave-bug-tracker] [bug #64960] jsonencode produces different results for single inputs than Matlab
Date: Sun, 3 Dec 2023 07:38:30 -0500 (EST)

Follow-up Comment #1, bug #64960 (project octave):

Fyi. Below test indicates that jsonencode in Matlab has native support for
single-floats which RapidJSON does not. We would pretty much need to extend
RapidJSON to include a Writer.Float function which limits the number of
decimals it outputs for float values.


MATLAB behaviour:

>> jsonencode(single(1.2))

ans =
    '1.2'

>> jsonencode(double(single(1.2)))

ans =
    '1.2000000476837158'


Btw. Thanks for picking up #64949 - I really appreciate it :-)


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?64960>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]