[Bug 272539] cospi, sinpi and tanpi incorrectly test for NaN and Infinity

From: <bugzilla-noreply_at_freebsd.org>
Date: Mon, 17 Jul 2023 05:26:38 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=272539

--- Comment #3 from commit-hook@FreeBSD.org ---
A commit in branch main references this bug:

URL:
https://cgit.FreeBSD.org/src/commit/?id=be4c7f273508994638b68d2fae742be37d3cb117

commit be4c7f273508994638b68d2fae742be37d3cb117
Author:     Steve Kargl <kargl@FreeBSD.org>
AuthorDate: 2023-07-17 05:19:28 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2023-07-17 05:23:27 +0000

    libm: correctly test for for NaN and Infinity in sinpi(), cospi(), and
tanpi()

    The current versions of lib/msun/src/s_cospi.c, s_sinpi.c and s_tanpi.c
    all exhibit the same defect. After checking for various numeric ranges,
    they check to see whether the input argument is a NaN or an Infinity.
    However, the code uses a value of 0x7f80000 instead of the correct value
    of 0x7ff00000.

    If you review s_cospif.c, s_sinpif.c, and s_tanpif.c, you will see that
    the equivalent statements in these functions are accurate and have
    appropriate source comments.

    The impact of these defects is to flag some valid input values as
    invalid and raise a pole error (divide by zero).

    Reported by:    Paul Green <Paul.Green@stratus.com>
    PR:     272539
    MFC after:      1 week

 lib/msun/src/s_cospi.c | 3 ++-
 lib/msun/src/s_sinpi.c | 3 ++-
 lib/msun/src/s_tanpi.c | 2 +-
 3 files changed, 5 insertions(+), 3 deletions(-)

-- 
You are receiving this mail because:
You are the assignee for the bug.