Bug 251091 - lib msun remainder() gives incorrect result on powerpc64
Summary: lib msun remainder() gives incorrect result on powerpc64
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: misc (show other bugs)
Version: CURRENT
Hardware: powerpc Any
: --- Affects Only Me
Assignee: freebsd-ppc (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-11-13 02:05 UTC by Alfredo Dal'Ava Junior
Modified: 2025-01-27 11:00 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alfredo Dal'Ava Junior freebsd_committer freebsd_triage 2020-11-13 02:05:09 UTC
lib msun remainder() function gives incorrect result on powerpc64, as reported by rem_test.c.
Expected result is 4.9406564584124654e-324, but -4.9406564584124654e-324 is given.

Reduced test case:

#include <openlibm.h>
#include <assert.h>


int main() 
{
	double x=-3.3770170061145426e-226;
	double y=2.4703282292062327e-323;
	double expected_rem = 4.9406564584124654e-324;

	double rem;

	rem = remainder(x, y);

	assert(rem == expected_rem);

	return(0);
}

* compile with "cc rem.c  -lm"
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2024-01-05 03:36:03 UTC
^Triage: canonicalize assignment.