12.345 -> 12.3 > -> 12.4In my opinion, the first one (12.3) is the correct 'mathematical rounding' (to 1 decimal here). However, some colleagues say the second one is correct.
This is the standard definition on base 10 ( a algebric group ) any element is a polynomial as: x=N(k)*10^K+...+N(0)*10^0+N(-1)*10^-1+N(-2)*10^-2.... the ROUND(x,h) is ROUND(x,h)=N(k)*10^K+...+N(0)*10^0+N(-1)*10^-1+N(-2)*10^-2....N'(-h)*10^(-h) where N'(-h)=N(-h) if 0<=N(-h)<5 ( base/2) ( 0,1,2,3,4 ) 5 weights N'(-h)=N(-h)+1 if 5<=N(-h) ( base/2) ( 5,6,7,8,9 ) 5 weights but this is a simplified definition for b=10. If the base is b=2*i+1 ( odd ) the definition is not therefore immediate. I prefer this: It is more syntetic and general ( for base b odd or even is ) definition is: N'(-h)=N(-h)+CARRY(x+x,-h) where CARRY(x+x,-h) is the carry at power -h of the x+x addition. example in base 3: ROUND(12.112,1)=12.2 ROUND(12.111,1)=12.1You have to observe a point:
* this is not a valid rule ROUND(x,h)=ROUND(ROUND(x,h+1),h)then:
ROUND(12.345,1)=12.3<>12.4=ROUND(12.35,1)=ROUND(12.345,2),1)This roundig rule don't minimize the computation error,