[Swan-dev] floating point time; Was: fyi, we've run out of impair+debug lset_t bits

Andrew Cagney andrew.cagney at gmail.com
Thu Sep 20 13:34:35 UTC 2018


> | PS: I'm tempted to make the HOW a float so 'times' can also be sent
> | over, later ...
>
> PLEASE: NO TO FLOATS.  They are the wrong abstraction.

(sarcasm) You mean hack the code so the other end has to distinguish
between deltatime_t and unsigned?  Next thing we know we'll be
changing the whack protocol so it talks ASN.1 as that would let us
correctly encode well everything ....  given the two types to send
over are seconds or fractions there off (as a double) and enums (as
whole floats) that looks much easier.

Anyway, for the user interface, the right abstraction is
floating-point.  For instance having:
                "       [--retransmit-timeout <seconds>] \\\n"
                "       [--retransmit-interval <msecs>] \\\n"
is nonsensical, the interface should accept seconds or factions there of:
   whack --retransmit-timeout 0.5
   whack --retransmit-interval 0.01
(is msecs micro-seconds as in 1/1_000 or milli-seconds as in
1/1_000_000_000, the only thing I'm sure of is that it isn't
nano-seconds as in 1/1_000; or am?)


More information about the Swan-dev mailing list