Fixed #22820 -- Treated int and long types alike in lazy_number

Thanks kwist for the report and the initial patch.