X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=3.6 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Message-ID: <4FA0291E.8040806@prolingua.co.uk> Date: Tue, 01 May 2012 19:19:10 +0100 From: David Matthews User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20120420 Thunderbird/12.0 MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: fesetround problem Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com 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 #include 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