Raised This Month: $ Target: $400
 0% 

float 1.3 + 0.1 = 1.399999


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Nextra
Veteran Member
Join Date: Apr 2008
Location: Germany
Old 01-16-2015 , 06:24   Re: float 1.3 + 0.1 = 1.399999
Reply With Quote #1

Quote:
Originally Posted by aron9forever View Post
since when does decimal selection round the float? shouldn't it still print 1.3 with %.1f of 1,39999?
Always. It tells it to round to X digits after the decimal point. However some implementations use "round to even" instead of the common "banker's rounding" so that's why you may be confused. Rounding does always occur but I'm not certain how (or by what) the method is specified.
__________________
In Flames we trust!
Nextra is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 15:30.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode