## RE: [Mingw-users] [mingw - C/C++] MinGW C-library: round(2.1) = 3 .0 ???

 RE: [Mingw-users] [mingw - C/C++] MinGW C-library: round(2.1) = 3 .0 ??? From: Wells, Roger K. - 2006-02-22 14:59:57 ```FWIW: round(2.000000) = 2.000000 round(2.100000) = 2.000000 round(2.200000) = 2.000000 round(2.300000) = 2.000000 round(2.400000) = 2.000000 round(2.500000) = 3.000000 round(2.600000) = 3.000000 round(2.700000) = 3.000000 round(2.800000) = 3.000000 round(2.900000) = 3.000000 WinXP, SP2 + gcc version 3.4.5 (mingw special) Roger Wells, P.E. SAIC 221 Third St Newport, RI 02840 401-847-4210 (voice) 401-849-1585 (fax) roger.k.wells@... -----Original Message----- From: mingw-users-admin@... [mailto:mingw-users-admin@...] On Behalf Of SourceForge.net Sent: Wednesday, February 22, 2006 9:40 AM To: noreply@... Subject: [Mingw-users] [mingw - C/C++] MinGW C-library: round(2.1) = 3.0 ??? Read and respond to this message at: https://sourceforge.net/forum/message.php?msg_id=3590721 By: elmarkrieger Hi everyone, this little program double t; for (t=2.0;t<3.0;t+=0.1) { printf("round(%f) = %f\n",t,round(t)); } gives the following output: round(2.000000) = 2.000000 round(2.100000) = 3.000000 round(2.200000) = 3.000000 round(2.300000) = 3.000000 round(2.400000) = 3.000000 round(2.500000) = 3.000000 round(2.600000) = 3.000000 round(2.700000) = 3.000000 round(2.800000) = 3.000000 round(2.900000) = 3.000000 Is this a parallel universe? I'm using the MinGW Linux cross-compile environment from http://www.libsdl.org/extras/win32/cross/ I replaced 'round' with 'nearbyint' which works, so this post is mainly for reference... Ciao and thanks, Elmar ______________________________________________________________________ You are receiving this email because you elected to monitor this forum. To stop monitoring this forum, login to SourceForge.net and visit: https://sourceforge.net/forum/unmonitor.php?forum_id=286529 ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 _______________________________________________ MinGW-users mailing list MinGW-users@... You may change your MinGW Account Options or unsubscribe at: https://lists.sourceforge.net/lists/listinfo/mingw-users ```

### Thread view

 RE: [Mingw-users] [mingw - C/C++] MinGW C-library: round(2.1) = 3 .0 ??? From: Wells, Roger K. - 2006-02-22 14:59:57 ```FWIW: round(2.000000) = 2.000000 round(2.100000) = 2.000000 round(2.200000) = 2.000000 round(2.300000) = 2.000000 round(2.400000) = 2.000000 round(2.500000) = 3.000000 round(2.600000) = 3.000000 round(2.700000) = 3.000000 round(2.800000) = 3.000000 round(2.900000) = 3.000000 WinXP, SP2 + gcc version 3.4.5 (mingw special) Roger Wells, P.E. SAIC 221 Third St Newport, RI 02840 401-847-4210 (voice) 401-849-1585 (fax) roger.k.wells@... -----Original Message----- From: mingw-users-admin@... [mailto:mingw-users-admin@...] On Behalf Of SourceForge.net Sent: Wednesday, February 22, 2006 9:40 AM To: noreply@... Subject: [Mingw-users] [mingw - C/C++] MinGW C-library: round(2.1) = 3.0 ??? Read and respond to this message at: https://sourceforge.net/forum/message.php?msg_id=3590721 By: elmarkrieger Hi everyone, this little program double t; for (t=2.0;t<3.0;t+=0.1) { printf("round(%f) = %f\n",t,round(t)); } gives the following output: round(2.000000) = 2.000000 round(2.100000) = 3.000000 round(2.200000) = 3.000000 round(2.300000) = 3.000000 round(2.400000) = 3.000000 round(2.500000) = 3.000000 round(2.600000) = 3.000000 round(2.700000) = 3.000000 round(2.800000) = 3.000000 round(2.900000) = 3.000000 Is this a parallel universe? I'm using the MinGW Linux cross-compile environment from http://www.libsdl.org/extras/win32/cross/ I replaced 'round' with 'nearbyint' which works, so this post is mainly for reference... Ciao and thanks, Elmar ______________________________________________________________________ You are receiving this email because you elected to monitor this forum. To stop monitoring this forum, login to SourceForge.net and visit: https://sourceforge.net/forum/unmonitor.php?forum_id=286529 ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 _______________________________________________ MinGW-users mailing list MinGW-users@... You may change your MinGW Account Options or unsubscribe at: https://lists.sourceforge.net/lists/listinfo/mingw-users ```