tcpdump mailing list archives

Re: POSIX and float rounding


From: Denis Ovsienko <denis () ovsienko info>
Date: Thu, 19 Mar 2026 23:52:33 +0000

On Thu, 19 Mar 2026 12:13:29 -0700
Guy Harris <gharris () sonic net> wrote:

In any case, given all this mishegoss, the right answer is probably
to have the script see how the floating-point value 0.5 is printed
with %.0f, and choose which test to perform based on that, in the
hopes that whatever rounding the scripting program does matches what
tcpdump will do.

Thank you for the detailed analysis.  Are you saying that fesetround()
cannot solve this problem reliably?

The simplest workaround would be to fork the test into one QNX-only
version and another except-QNX version (assuming QNX does not change its
rounding method).

-- 
    Denis Ovsienko
_______________________________________________
tcpdump-workers mailing list -- tcpdump-workers () lists tcpdump org
To unsubscribe send an email to tcpdump-workers-leave () lists tcpdump org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s


Current thread: