On 2/26/2026 7:19 PM, Stephen Hemminger wrote:
On Thu, 26 Feb 2026 16:44:49 +0000
Anatoly Burakov <[email protected]> wrote:

+       if (type == RTE_FLOAT_SINGLE)
+               dres = (double)strtof(srcbuf, &end);
+       else if (type == RTE_FLOAT_DOUBLE)
+               dres = strtod(srcbuf, &end);
+       else
+               return -1;
+

You could use strtod for both.
The conversion from double to float could happen in caller.

I did have that previously, but parsing a float as double then converting it to float yields slightly different result than parsing it as a float directly. Unit tests expose the difference.

--
Thanks,
Anatoly

Reply via email to