This is the mail archive of the
cygwin
mailing list for the Cygwin project.
fesetround problem
- From: David Matthews <dm at prolingua dot co dot uk>
- To: cygwin at cygwin dot com
- Date: Tue, 01 May 2012 19:19:10 +0100
- Subject: fesetround problem
fesetround seems to be broken in the current version of Cygwin. It
returns EINVAL for any argument other than FE_TONEAREST. The following
snippet works fine on Debian wheezy but shows a non-zero return in Cygwin.
#include <fenv.h>
#include <stdio.h>
int main()
{
int r = fesetround(FE_TOWARDZERO);
printf("fesetround returned %d. Current rounding is %d\n",
r, fegetround());
return 0;
}
Browsing the CVS source it looks as though the problem is the line in
fesetround in fenv.c that says:
if (round & ~(FE_CW_ROUND_MASK >> FE_CW_PREC_SHIFT))
I think FE_CW_PREC_SHIFT should be FE_CW_ROUND_SHIFT to match fegetround
above.
David
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple