[Git][NTPsec/ntpsec][master] Warn about dolfptoa/atolfp not round-tripping.

Eric S. Raymond gitlab at mg.gitlab.com
Tue Dec 29 19:31:57 UTC 2015


Eric S. Raymond pushed to branch master at NTPsec / ntpsec


Commits:
55e2ff03 by Eric S. Raymond at 2015-12-29T10:00:16Z
Warn about dolfptoa/atolfp not round-tripping.

Include one of Hal's error cases.

- - - - -


1 changed file:

- libntp/dolfptoa.c


Changes:

=====================================
libntp/dolfptoa.c
=====================================
--- a/libntp/dolfptoa.c
+++ b/libntp/dolfptoa.c
@@ -1,5 +1,10 @@
 /*
  * dolfptoa - do the grunge work of converting an l_fp number to decimal
+ *
+ * Warning: this conversion is lossy in the low-order bits of the fractional
+ * part.  It's good enough for statistics and logging, but do not expect 
+ * it to round-trip through atolfp(). 1444359386.1798776096, for example, may
+ * dump as ...095 or ...097.
  */
 #include <config.h>
 #include <stdio.h>



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/55e2ff037eb48f0059e7d1b9d7fd5aeb95e2749b
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ntpsec.org/pipermail/vc/attachments/20151229/22031087/attachment.html>


More information about the vc mailing list