fix signed/unsigned comparison
use proper floating point literal instead of implicit cast from int