buf fix: floating point exception