Logical shift right by zero must produce a positive result.
Code cleanup: use helpers for integer -> double conversion