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)
Depends on:
Reported: 2020-11-13 02:05 UTC by Alfredo Dal'Ava Junior
Modified: 2020-11-13 02:19 UTC (History)
1 user (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Alfredo Dal'Ava Junior freebsd_committer 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);


* compile with "cc rem.c  -lm"