dynadec.com

dynadec user support forums
It is currently Wed Sep 08, 2010 4:34 pm

All times are UTC - 5 hours [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: round and negative floats
PostPosted: Fri Mar 05, 2010 5:19 pm 
Offline

Joined: Mon Feb 15, 2010 5:53 am
Posts: 13
float x = -0.4;
cout << x << " rounds to " << round(x) << endl;
x = -0.5;
cout << x << " rounds to " << round(x) << endl;
x = -0.9;
cout << x << " rounds to " << round(x) << endl;

produces

-0.400000 rounds to -1.000000
-0.500000 rounds to -0.000000
-0.900000 rounds to -0.000000

thanks - jon


Top
 Profile E-mail  
 
 Post subject: Re: round and negative floats
PostPosted: Sat Mar 06, 2010 4:36 am 
Offline

Joined: Tue Nov 18, 2008 11:21 am
Posts: 121
Thank you for the report.
It seems to be a windows problem only.

Pierre


Top
 Profile E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group