d2jsp
Log InRegister
d2jsp Forums > Off-Topic > General Chat > Homework Help > Rounding With Binary Numbers
Add Reply New Topic New Poll
Member
Posts: 13,681
Joined: Sep 23 2008
Gold: 9,150.00
Mar 15 2014 04:48pm
Hey hey.
Well, generally I understand how round to nearest and round to even if needed with floating numbers works, but I'm not sure about one specific case.
Say, 1001.011 rounded to 2 digits. What will it be? 1001.01? 1001.00? 1001.10?

Thanks for the help.
Member
Posts: 16,992
Joined: Aug 28 2008
Gold: 1,773.03
Trader: Trusted
Mar 15 2014 05:32pm
e: better explained below :)

This post was edited by D2FreakIt on Mar 15 2014 05:34pm
Member
Posts: 16,662
Joined: Nov 24 2007
Gold: 15,245.00
Trader: Trusted
Mar 15 2014 05:32pm
1001.011 is exactly the mean between 1001.01 and 1001.10

There are 2 different 'nearest' approximation using 2 'digits'.

Or you can choose to round down to 1001.01, or to round up to 1001.10

What would you do, using decimal system, with 237.435 ? 237.43 or 237.44 ?
Member
Posts: 13,681
Joined: Sep 23 2008
Gold: 9,150.00
Mar 15 2014 06:07pm
Yes, if it's exactly the middle "round to even" should apply. But I don't know what that is in that case.
I guess 1001.10 right?
tho that should be 1001.00 then, no? But that would make quite no sense as it would be totally off ^.^

This post was edited by The_Darkness_II on Mar 15 2014 06:21pm
Member
Posts: 28,331
Joined: Jun 9 2007
Gold: 11,700.00
Mar 15 2014 06:31pm
Quote (The_Darkness_II @ 16 Mar 2014 00:07)
Yes, if it's exactly the middle "round to even" should apply. But I don't know what that is in that case.
I guess 1001.10 right?
tho that should be 1001.00 then, no? But that would make quite no sense as it would be totally off ^.^


"round to even"? it's "round up" (or "round away from zero") as standard rule really, ie 1001.10 would be the answer
are you asked specifically to use "round to even"?

1001.00 would definitely be incorrect, if you were asked to round to the nearest whole number 1001 would be correct though

This post was edited by brmv on Mar 15 2014 06:48pm
Member
Posts: 13,681
Joined: Sep 23 2008
Gold: 9,150.00
Mar 15 2014 06:57pm
Round to even (or apparently also called round half to even) is also often used for tie-breaking afaik.
http://en.wikipedia.org/wiki/Rounding#Round_half_to_even
I'm asked to use round to nearest and if the digit is in the mean use round to even.

1.001 round to 2 digits by round to even would be 1.00, but I don't know how it is handled if the second digit is also 1, i.e. (1.011). Either (1.10) or (1.00), which would be kinda screwed up imo but I can't find any definition/reasoning that it would be (1.10) in such a case.
Go Back To Homework Help Topic List
Add Reply New Topic New Poll