emacs-devel
[Top][All Lists]
Advanced

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

Re: Improving JSON pretty printing, how to represent floats?


From: Eli Zaretskii
Subject: Re: Improving JSON pretty printing, how to represent floats?
Date: Fri, 05 Apr 2024 16:09:53 +0300

> From: Herman, Géza <geza.herman@gmail.com>
> Cc: Géza Herman <geza.herman@gmail.com>,
>  emacs-devel@gnu.org
> Date: Fri, 05 Apr 2024 14:55:26 +0200
> 
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > The digits in 3.333333333333000000000000000001 after 16th digit
> > are meaningless: they aren't supported by IEEE floating-point
> > standard, so they are just numerical noise.  Thus, talking about
> > "lossless" wrt them makes little sense to me.
> 
> You mean the 64-bit binary format. IEEE-754 describes more formats 
> which have more precision, and also there are more formats used in 
> practice than what IEEE-754 describes.
> 
> Plus, I don't think that the JSON standard mandates IEEE-754 
> numbers.  It just describes numbers, so I think it's good behavior 
> to not change numbers during formatting.

The fact that Emacs supports IEEE-754 on almost all platforms is
prominently documented in the ELisp reference manual, see the node
"Float Basics" there.



reply via email to

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