I doubt if this is a bug or not. The rounding mode you describe is so-called "round to the nearest even" which is described in ISO 31-0 as "generally preferable". Maybe the author of sprintf explicitly chose such mode (not sure). It seems the problem here is whether should we specify sprintf's rounding mode or leave it implementation-defined.