fix(library/num): bug in to_pos_num, missing test

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>