News for hackers. Stuff that matters.
Re:Varlink – IPC to replace D-Bus gradually in systemd by Netch on Monday October 07, 2024 @06:25AM (#41764562)
> If you really want real numbers passing them as decimal string is actually sensible.

Hexadecimal, if so. Nearly any decent modern language and runtime can it.

    $ python
    >>> import math
    >>> math.pi.hex()
    '0x1.921fb54442d18p+1'
This gives exact value without any rounding effects and conversion cost.

(I donʼt count decimal floating-point as it is quite rare and its application is faint. In overwhelming most of cases, fixed point is better.)

There are no comments on this comment yet.