Re: float_to_list(X)

Eckard Brauer <[email protected]>
Newsgroups gmane.comp.lang.erlang.general
Message-ID <[email protected]>
For that purpose it makes maybe more sense to show a sort of "hybrid"
representation of the form floats are usually represented in memory:

s 1.mmmm e xxxx

where

s    is signum ("-", "+" or empty),
mmmm    is mantissa, in hex, oct or bin to effectively express all
relevant digit positions (with removed trailing zeroes),
xxxx    is exponent with possible "-" and also all digits needed.

That would be both human readable and provide some metric, while still
keeping some compactness (maybe not really true for the binary form)
and unambiguousness.

Just my 2 cents.

E.

Am Fri, 7 May 2021 22:26:39 +1200
schrieb "Richard O'Keefe" <[email protected]>:

> Two different floats, no matter how small the difference,
> should result in different lists.  It's meant for converting a float
> to text that you can send to another machine and reconstitute the
> same value there.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.