delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/06/04/12:58:47

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-ID: <BAY14-F212498F03CFC02D16F95FED0F90@phx.gbl>
X-Originating-Email: [lukeh-temp-email AT hotmail DOT com]
X-Sender: lukeh-temp-email AT hotmail DOT com
From: "Luke Hutchinson" <lukeh-temp-email AT hotmail DOT com>
To: cygwin AT cygwin DOT com
Subject: lrint() incorrect results.
Date: Sun, 05 Jun 2005 02:58:34 +1000
Mime-Version: 1.0
X-IsSubscribed: yes

lrint() does not appear to be working correctly under Cygwin.

The following simple test program compiled with g++ 3.3.3 demonstrates the 
problem.

#include <iostream>
#include <cmath>

int main(void) {
    std::cout << "lrintf(0.5f)\t"  << lrintf(0.5f)  << "\n"
                 "lrintf(-0.5f)\t" << lrintf(-0.5f) << "\n"
                 "lrint(0.5)\t"    << lrint(0.5)    << "\n"
                 "lrint(-0.5)\t"   << lrint(0.5)    << std::endl;
    return 0;
}

The output is

lrintf(0.5f)    0
lrintf(-0.5f)   0
lrint(0.5)      2
lrint(-0.5)     2

Running the same code under Linux (fedora core 1) gives the expected results 
of,

lrintf(0.5f)    0
lrintf(-0.5f)   0
lrint(0.5)      0
lrint(-0.5)     0

- Luke

_________________________________________________________________
REALESTATE: biggest buy/rent/share listings   
http://ninemsn.realestate.com.au


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019