View Full Version: Ahh, rounding!

Dozensonline > Number Bases > Ahh, rounding!


Title: Ahh, rounding!
Description: Dontcha just love dozenal rounding!


icarus - August 13, 2009 12:41 AM (GMT)
Today I calculated a progress in pergross (vs. percent) for a dozenal publication. I got a result like 18;4592497... and suppose we want three sig figs. That five does nothing! so inclined to round when I see a five (lost track of that every other five when something else goes on). Maybe there are similar rounding rules for twelve. More enlightened fellas will likely post to tell ya what they are...

Dan - August 13, 2009 12:48 AM (GMT)
Simple: 0-5 get rounded down and 6-Ɛ get rounded up.

Shaun - August 13, 2009 07:11 PM (GMT)
"Round to even" - which is used with decimals (e.g. 0.25 -> 0.2 and 0.35 -> 0.4)
so 0'76 rounds to 0'8 and 0'86 rounds to 0'8.

Dan - August 15, 2009 04:50 PM (GMT)
To generalize,

In even bases

1/2 is represented by 0.n where n=base/2

Round up if the first digit after the rounding place is base/2 or greater.
Round down (i.e., truncate) otherwise.

Optionally, round an exact half to the nearest even number.

In odd bases

1/2 is represented by 0.nnnnnnnnnnnn... where n=(base-1)/2.

Round up if the first digit after the rounding place greater than base/2.
Round down (i.e., truncate) otherwise.
Do this one digit at a time.

For example, rounding 0.333334 base 7 (~0.50000425 decimal or 0.6000108 dozenal) to two septimal places gives the sequence 0.33334, 0.3334, 0.334, for a result of 0.34.

Rounding to even is less relevant because an exact half cannot be represented without repeating digits.




Hosted for free by InvisionFree