rrwick / Polypolish

a short-read polishing tool for long-read assemblies
GNU General Public License v3.0
146 stars 10 forks source link

feat: faster rounding with bitwise and operation #20

Closed lavafroth closed 9 months ago

lavafroth commented 10 months ago

This PR replaces the current modulo by 2 operation with a bitwise operation. We and the truncated number with 1 which yields 1 if odd, 0 otherwise. Then we immediately add it to the truncated number.

rrwick commented 9 months ago

Thanks for this!